Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@
"default": "",
"description": "Manually set a language server executable. Can be something on the $PATH or a path to an executable itself. Works with ~, ${HOME} and ${workspaceFolder}."
},
"haskell.ignoreStandalone": {
"scope": "resource",
"type": "boolean",
"default": false,
"description": "Don't spawn language servers for stand-alone files (i.e. files that don't belong to any folder)"
},
"haskell.updateBehavior": {
"scope": "machine",
"type": "string",
Expand Down
3 changes: 2 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ async function activeServer(context: ExtensionContext, document: TextDocument) {
}

async function activateServerForFolder(context: ExtensionContext, uri: Uri, folder?: WorkspaceFolder) {
const ignoreStandalone = workspace.getConfiguration('haskell').ignoreStandalone;
const clientsKey = folder ? folder.uri.toString() : uri.toString();

if (!folder && ignoreStandalone) return;
// If the client already has an LSP server for this uri/folder, then don't start a new one.
if (clients.has(clientsKey)) {
return;
Expand Down