Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelangeloio committed Jan 9, 2024
1 parent 939f731 commit 87135bc
Showing 1 changed file with 20 additions and 24 deletions.
44 changes: 20 additions & 24 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,26 @@ let hasConfigurationCapability = false
let hasWorkspaceFolderCapability = false

connection.onInitialize((params: InitializeParams) => {
const capabilities = params.capabilities;

// Does the client support the `workspace/configuration` request?
// If not, we fall back using global settings.
hasConfigurationCapability = !!(
capabilities.workspace && !!capabilities.workspace.configuration
);
hasWorkspaceFolderCapability = !!(
capabilities.workspace && !!capabilities.workspace.workspaceFolders
);

const result: InitializeResult = {
capabilities: {
textDocumentSync: TextDocumentSyncKind.Incremental,
}
};
if (hasWorkspaceFolderCapability) {
result.capabilities.workspace = {
workspaceFolders: {
supported: true
}
};
}
return result;
const capabilities = params.capabilities

// Does the client support the `workspace/configuration` request?
// If not, we fall back using global settings.
hasConfigurationCapability = !!(capabilities.workspace && !!capabilities.workspace.configuration)
hasWorkspaceFolderCapability = !!(capabilities.workspace && !!capabilities.workspace.workspaceFolders)

const result: InitializeResult = {
capabilities: {
textDocumentSync: TextDocumentSyncKind.Incremental
}
}
if (hasWorkspaceFolderCapability) {
result.capabilities.workspace = {
workspaceFolders: {
supported: true
}
}
}
return result
})

connection.onInitialized(() => {
Expand Down

0 comments on commit 87135bc

Please sign in to comment.