-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix-remove-experiments
- Loading branch information
Showing
26 changed files
with
869 additions
and
858 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { workspace } from 'vscode' | ||
import { | ||
LanguageClient as Client, | ||
LanguageClientOptions, | ||
ServerOptions, | ||
TransportKind | ||
} from 'vscode-languageclient/node' | ||
import { documentSelector, serverModule } from 'dvc-vscode-lsp' | ||
import { Disposable } from '../class/dispose' | ||
import { readFileContents } from '../fileSystem' | ||
|
||
export class LanguageClient extends Disposable { | ||
private client: Client | ||
|
||
constructor() { | ||
super() | ||
|
||
const clientOptions: LanguageClientOptions = { | ||
documentSelector, | ||
synchronize: { | ||
fileEvents: workspace.createFileSystemWatcher('**/dvc.yaml') | ||
} | ||
} | ||
|
||
this.client = this.dispose.track( | ||
new Client( | ||
'dvc-vscode-lsp', | ||
'DVC Language Server', | ||
this.getServerOptions(), | ||
clientOptions | ||
) | ||
) | ||
|
||
this.dispose.track( | ||
this.client.onRequest('readFileContents', readFileContents) | ||
) | ||
|
||
void this.client.start() | ||
} | ||
|
||
private getServerOptions(): ServerOptions { | ||
const debugOptions = { execArgv: ['--nolazy', '--inspect=6009'] } | ||
|
||
return { | ||
debug: { | ||
module: serverModule, | ||
options: debugOptions, | ||
transport: TransportKind.ipc | ||
}, | ||
run: { module: serverModule, transport: TransportKind.ipc } | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.