Skip to content

Commit 80353f9

Browse files
committed
feat: SymbolTable creator
feat: Goto defintion handler. feat: Hover handler, display information. feat: Semantic highlighting
1 parent cc782c3 commit 80353f9

File tree

18 files changed

+858
-1167
lines changed

18 files changed

+858
-1167
lines changed

client/src/extension.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import * as vscode from 'vscode';
99
import {
1010
LanguageClient,
1111
LanguageClientOptions,
12+
SemanticTokenModifiers,
13+
SemanticTokenTypes,
1214
ServerOptions,
1315
TransportKind
1416
} from 'vscode-languageclient/node';
@@ -24,21 +26,21 @@ let forceAddModule = ZSconfig.get<boolean>('forceAddModule', false)
2426
export function activate(context: vscode.ExtensionContext) {
2527

2628
// const command = "extension.formatDocument";
27-
29+
2830
// context.subscriptions.push(vscode.commands.registerCommand(command, formatDocument));
2931

3032
let languageServerRunning = ZSconfig.get<boolean>('serverStartupSetting', false); // Default to 2 if not set
3133

3234
context.subscriptions.push(vscode.commands.registerCommand('ZeroSyntax.stopLanguageServer', () => {
33-
if(languageServerRunning) {
35+
if (languageServerRunning) {
3436
console.log(`Stopping LS...`)
3537
client.stop();
3638
languageServerRunning = false;
3739
}
3840
}));
3941

4042
context.subscriptions.push(vscode.commands.registerCommand('ZeroSyntax.startLanguageServer', () => {
41-
if(!languageServerRunning) {
43+
if (!languageServerRunning) {
4244
console.log(`Starting LS...`)
4345
client.start();
4446
languageServerRunning = true;
@@ -69,6 +71,10 @@ export function activate(context: vscode.ExtensionContext) {
6971
synchronize: {
7072
// Notify the server about file changes to '.clientrc files contained in the workspace
7173
fileEvents: vscode.workspace.createFileSystemWatcher('**/.clientrc')
74+
},
75+
initializationOptions: {
76+
SemanticTokenTypes,
77+
SemanticTokenModifiers
7278
}
7379
};
7480

@@ -81,20 +87,20 @@ export function activate(context: vscode.ExtensionContext) {
8187
);
8288

8389
// Start the client. This will also launch the server
84-
if(languageServerRunning) {
90+
if (languageServerRunning) {
8591
client.start();
8692
}
8793
}
8894

8995
vscode.workspace.onDidChangeConfiguration((e) => {
90-
if(e.affectsConfiguration('ZeroSyntax.serverStartupSetting')) {
96+
if (e.affectsConfiguration('ZeroSyntax.serverStartupSetting')) {
9197
languageServerRunning = ZSconfig.get<boolean>('serverStartupSetting', false);
9298
toggleLanguageServer();
9399
}
94100
});
95101

96102
function toggleLanguageServer() {
97-
if(languageServerRunning) {
103+
if (languageServerRunning) {
98104
client.stop();
99105
languageServerRunning = false;
100106
} else {

0 commit comments

Comments
 (0)