44 * Licensed under the MIT License. See License.txt in the project root for license information.
55 * ------------------------------------------------------------------------------------------ */
66
7- import * as path from " path" ;
7+ import * as path from ' path' ;
88// import { workspace, ExtensionContext } from "vscode";
9- import * as vscode from " vscode" ;
9+ import * as vscode from ' vscode' ;
1010
1111import {
1212 LanguageClient ,
1313 LanguageClientOptions ,
1414 ServerOptions ,
1515 TransportKind ,
16- } from " vscode-languageclient/node" ;
16+ } from ' vscode-languageclient/node' ;
1717
1818let client : LanguageClient ;
1919
2020export function activate ( context : vscode . ExtensionContext ) {
21- console . log ( " Terminals: " + ( < any > vscode . window ) . terminals . length ) ;
21+ console . log ( ' Terminals: ' + ( < any > vscode . window ) . terminals . length ) ;
2222 context . subscriptions . push (
23- vscode . window . registerTerminalProfileProvider ( " nushell_default" , {
23+ vscode . window . registerTerminalProfileProvider ( ' nushell_default' , {
2424 provideTerminalProfile (
25- token : vscode . CancellationToken
25+ token : vscode . CancellationToken ,
2626 ) : vscode . ProviderResult < vscode . TerminalProfile > {
27- const which = require ( " which" ) ;
28- const path = require ( " path" ) ;
27+ const which = require ( ' which' ) ;
28+ const path = require ( ' path' ) ;
2929
30- const PATH_FROM_ENV = process . env [ " PATH" ] ;
30+ const PATH_FROM_ENV = process . env [ ' PATH' ] ;
3131 const pathsToCheck = [
3232 PATH_FROM_ENV ,
3333 // cargo install location
34- ( process . env [ " CARGO_HOME" ] || " ~/.cargo" ) + " /bin" ,
34+ ( process . env [ ' CARGO_HOME' ] || ' ~/.cargo' ) + ' /bin' ,
3535
3636 // winget on Windows install location
37- " c:\\program files\\nu\\bin" ,
37+ ' c:\\program files\\nu\\bin' ,
3838 // just add a few other drives for fun
39- " d:\\program files\\nu\\bin" ,
40- " e:\\program files\\nu\\bin" ,
41- " f:\\program files\\nu\\bin" ,
39+ ' d:\\program files\\nu\\bin' ,
40+ ' e:\\program files\\nu\\bin' ,
41+ ' f:\\program files\\nu\\bin' ,
4242
4343 // SCOOP:TODO
4444 // all user installed programs and scoop itself install to
@@ -60,40 +60,40 @@ export function activate(context: vscode.ExtensionContext) {
6060
6161 // brew install location mac
6262 // intel
63- " /usr/local/bin" ,
63+ ' /usr/local/bin' ,
6464 // arm
65- " /opt/homebrew/bin" ,
65+ ' /opt/homebrew/bin' ,
6666
6767 // native package manager install location
6868 // standard location should be in `PATH` env var
6969 //"/usr/bin/nu",
7070 ] ;
7171
72- const found_nushell_path = which . sync ( "nu" , {
72+ const found_nushell_path = which . sync ( 'nu' , {
7373 nothrow : true ,
7474 path : pathsToCheck . join ( path . delimiter ) ,
7575 } ) ;
7676
7777 if ( found_nushell_path == null ) {
7878 console . log (
79- " Nushell not found in env:PATH or any of the heuristic locations."
79+ ' Nushell not found in env:PATH or any of the heuristic locations.' ,
8080 ) ;
8181 // use an async arrow funciton to use `await` inside
8282 return ( async ( ) => {
8383 if (
8484 ( await vscode . window . showErrorMessage (
85- " We cannot find a nushell executable in your path or pre-defined locations" ,
86- " install from website"
85+ ' We cannot find a nushell executable in your path or pre-defined locations' ,
86+ ' install from website' ,
8787 ) ) &&
8888 ( await vscode . env . openExternal (
89- vscode . Uri . parse ( " https://www.nushell.sh/" )
89+ vscode . Uri . parse ( ' https://www.nushell.sh/' ) ,
9090 ) ) &&
9191 ( await vscode . window . showInformationMessage (
92- " after you install nushell, you might need to reload vscode" ,
93- " reload now"
92+ ' after you install nushell, you might need to reload vscode' ,
93+ ' reload now' ,
9494 ) )
9595 ) {
96- vscode . commands . executeCommand ( " workbench.action.reloadWindow" ) ;
96+ vscode . commands . executeCommand ( ' workbench.action.reloadWindow' ) ;
9797 }
9898 // user has already seen error messages, but they didn't click through
9999 // return a promise that never resolve to supress the confusing error
@@ -103,26 +103,26 @@ export function activate(context: vscode.ExtensionContext) {
103103
104104 return {
105105 options : {
106- name : " Nushell" ,
106+ name : ' Nushell' ,
107107 shellPath : found_nushell_path ,
108108 iconPath : vscode . Uri . joinPath (
109109 context . extensionUri ,
110- " assets/nu.svg"
110+ ' assets/nu.svg' ,
111111 ) ,
112112 } ,
113113 } ;
114114 } ,
115- } )
115+ } ) ,
116116 ) ;
117117
118118 // The server is implemented in node
119119 const serverModule = context . asAbsolutePath (
120- path . join ( " out" , " server" , " src" , " server.js" )
120+ path . join ( ' out' , ' server' , ' src' , ' server.js' ) ,
121121 ) ;
122122
123123 // The debug options for the server
124124 // --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging
125- const debugOptions = { execArgv : [ " --nolazy" , " --inspect=6009" ] } ;
125+ const debugOptions = { execArgv : [ ' --nolazy' , ' --inspect=6009' ] } ;
126126
127127 // If the extension is launched in debug mode then the debug server options are used
128128 // Otherwise the run options are used
@@ -138,10 +138,10 @@ export function activate(context: vscode.ExtensionContext) {
138138 // Options to control the language client
139139 const clientOptions : LanguageClientOptions = {
140140 // Register the server for plain text documents
141- documentSelector : [ { scheme : " file" , language : " nushell" } ] ,
141+ documentSelector : [ { scheme : ' file' , language : ' nushell' } ] ,
142142 synchronize : {
143143 // Notify the server about file changes to '.clientrc files contained in the workspace
144- fileEvents : vscode . workspace . createFileSystemWatcher ( " **/.clientrc" ) ,
144+ fileEvents : vscode . workspace . createFileSystemWatcher ( ' **/.clientrc' ) ,
145145 } ,
146146 markdown : {
147147 isTrusted : true
@@ -150,10 +150,10 @@ export function activate(context: vscode.ExtensionContext) {
150150
151151 // Create the language client and start the client.
152152 client = new LanguageClient (
153- " nushellLanguageServer" ,
154- " Nushell Language Server" ,
153+ ' nushellLanguageServer' ,
154+ ' Nushell Language Server' ,
155155 serverOptions ,
156- clientOptions
156+ clientOptions ,
157157 ) ;
158158
159159 // Start the client. This will also launch the server
0 commit comments