mirror of
https://github.com/tiennm99/serena.git
synced 2026-09-04 04:18:11 +00:00
Simplified config of various LS, tests run through
This commit is contained in:
@@ -116,16 +116,11 @@ class ClojureLSP(SolidLanguageServer):
|
||||
"processId": os.getpid(),
|
||||
"rootPath": repository_absolute_path,
|
||||
"rootUri": root_uri,
|
||||
"clientInfo": {"name": "solidlsp", "version": "0.1.0"},
|
||||
"capabilities": {
|
||||
"workspace": {
|
||||
"applyEdit": True,
|
||||
"workspaceEdit": {"documentChanges": True},
|
||||
"symbol": {
|
||||
"symbolKind": {
|
||||
"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
|
||||
}
|
||||
},
|
||||
"symbol": {"symbolKind": {"valueSet": list(range(1, 27))}},
|
||||
"workspaceFolders": True,
|
||||
},
|
||||
"textDocument": {
|
||||
@@ -133,13 +128,10 @@ class ClojureLSP(SolidLanguageServer):
|
||||
"publishDiagnostics": {"relatedInformation": True, "tagSupport": {"valueSet": [1, 2]}},
|
||||
"definition": {"linkSupport": True},
|
||||
"references": {},
|
||||
"completion": {"completionItem": {"snippetSupport": True, "documentationFormat": ["markdown", "plaintext"]}},
|
||||
"hover": {"contentFormat": ["markdown", "plaintext"]},
|
||||
"documentSymbol": {
|
||||
"hierarchicalDocumentSymbolSupport": True,
|
||||
"symbolKind": {
|
||||
"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
|
||||
},
|
||||
"symbolKind": {"valueSet": list(range(1, 27))}, #
|
||||
},
|
||||
},
|
||||
"general": {"positionEncodings": ["utf-16"]},
|
||||
|
||||
@@ -499,9 +499,7 @@ class CSharpLanguageServer(SolidLanguageServer):
|
||||
"didChangeWatchedFiles": {"dynamicRegistration": True},
|
||||
"symbol": {
|
||||
"dynamicRegistration": True,
|
||||
"symbolKind": {
|
||||
"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
|
||||
},
|
||||
"symbolKind": {"valueSet": list(range(1, 27))},
|
||||
},
|
||||
"executeCommand": {"dynamicRegistration": True},
|
||||
"configuration": True,
|
||||
@@ -510,20 +508,6 @@ class CSharpLanguageServer(SolidLanguageServer):
|
||||
},
|
||||
"textDocument": {
|
||||
"synchronization": {"dynamicRegistration": True, "willSave": True, "willSaveWaitUntil": True, "didSave": True},
|
||||
"completion": {
|
||||
"dynamicRegistration": True,
|
||||
"contextSupport": True,
|
||||
"completionItem": {
|
||||
"snippetSupport": True,
|
||||
"commitCharactersSupport": True,
|
||||
"documentationFormat": ["markdown", "plaintext"],
|
||||
"deprecatedSupport": True,
|
||||
"preselectSupport": True,
|
||||
},
|
||||
"completionItemKind": {
|
||||
"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
|
||||
},
|
||||
},
|
||||
"hover": {"dynamicRegistration": True, "contentFormat": ["markdown", "plaintext"]},
|
||||
"signatureHelp": {
|
||||
"dynamicRegistration": True,
|
||||
@@ -534,38 +518,11 @@ class CSharpLanguageServer(SolidLanguageServer):
|
||||
},
|
||||
"definition": {"dynamicRegistration": True},
|
||||
"references": {"dynamicRegistration": True},
|
||||
"documentHighlight": {"dynamicRegistration": True},
|
||||
"documentSymbol": {
|
||||
"dynamicRegistration": True,
|
||||
"symbolKind": {
|
||||
"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
|
||||
},
|
||||
"symbolKind": {"valueSet": list(range(1, 27))},
|
||||
"hierarchicalDocumentSymbolSupport": True,
|
||||
},
|
||||
"codeAction": {
|
||||
"dynamicRegistration": True,
|
||||
"codeActionLiteralSupport": {
|
||||
"codeActionKind": {
|
||||
"valueSet": [
|
||||
"",
|
||||
"quickfix",
|
||||
"refactor",
|
||||
"refactor.extract",
|
||||
"refactor.inline",
|
||||
"refactor.rewrite",
|
||||
"source",
|
||||
"source.organizeImports",
|
||||
]
|
||||
}
|
||||
},
|
||||
},
|
||||
"codeLens": {"dynamicRegistration": True},
|
||||
"formatting": {"dynamicRegistration": True},
|
||||
"rangeFormatting": {"dynamicRegistration": True},
|
||||
"onTypeFormatting": {"dynamicRegistration": True},
|
||||
"rename": {"dynamicRegistration": True},
|
||||
"publishDiagnostics": {"relatedInformation": True},
|
||||
"foldingRange": {"dynamicRegistration": True, "rangeLimit": 5000, "lineFoldingOnly": True},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -99,7 +99,6 @@ class DartLanguageServer(SolidLanguageServer):
|
||||
"capabilities": {},
|
||||
"initializationOptions": {
|
||||
"onlyAnalyzeProjectsWithOpenFiles": False,
|
||||
"suggestFromUnimportedLibraries": True,
|
||||
"closingLabels": False,
|
||||
"outline": False,
|
||||
"flutterOutline": False,
|
||||
|
||||
@@ -319,10 +319,15 @@ class EclipseJDTLS(SolidLanguageServer):
|
||||
Returns the initialize parameters for the EclipseJDTLS server.
|
||||
"""
|
||||
# Look into https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java to understand all the options available
|
||||
|
||||
if not os.path.isabs(repository_absolute_path):
|
||||
repository_absolute_path = os.path.abspath(repository_absolute_path)
|
||||
repo_uri = pathlib.Path(repository_absolute_path).as_uri()
|
||||
|
||||
initialize_params = {
|
||||
"locale": "en",
|
||||
"rootPath": "repository_absolute_path",
|
||||
"rootUri": "pathlib.Path(repository_absolute_path).as_uri()",
|
||||
"rootPath": repository_absolute_path,
|
||||
"rootUri": pathlib.Path(repository_absolute_path).as_uri(),
|
||||
"capabilities": {
|
||||
"workspace": {
|
||||
"applyEdit": True,
|
||||
@@ -754,27 +759,16 @@ class EclipseJDTLS(SolidLanguageServer):
|
||||
"triggerFiles": [],
|
||||
},
|
||||
"trace": "verbose",
|
||||
"processId": os.getpid(),
|
||||
"workspaceFolders": [
|
||||
{
|
||||
"uri": repo_uri,
|
||||
"name": os.path.basename(repository_absolute_path),
|
||||
}
|
||||
],
|
||||
}
|
||||
|
||||
if not os.path.isabs(repository_absolute_path):
|
||||
repository_absolute_path = os.path.abspath(repository_absolute_path)
|
||||
|
||||
initialize_params["processId"] = os.getpid()
|
||||
|
||||
initialize_params["rootPath"] = repository_absolute_path
|
||||
|
||||
initialize_params["rootUri"] = pathlib.Path(repository_absolute_path).as_uri()
|
||||
|
||||
repo_uri = pathlib.Path(repository_absolute_path).as_uri()
|
||||
initialize_params["initializationOptions"]["workspaceFolders"] = [repo_uri]
|
||||
|
||||
initialize_params["workspaceFolders"] = [
|
||||
{
|
||||
"uri": repo_uri,
|
||||
"name": os.path.basename(repository_absolute_path),
|
||||
}
|
||||
]
|
||||
|
||||
bundles = [self.runtime_dependency_paths.intellicode_jar_path]
|
||||
initialize_params["initializationOptions"]["bundles"] = bundles
|
||||
initialize_params["initializationOptions"]["settings"]["java"]["configuration"]["runtimes"] = [
|
||||
|
||||
@@ -93,14 +93,11 @@ class Gopls(SolidLanguageServer):
|
||||
"capabilities": {
|
||||
"textDocument": {
|
||||
"synchronization": {"didSave": True, "dynamicRegistration": True},
|
||||
"completion": {"dynamicRegistration": True, "completionItem": {"snippetSupport": True}},
|
||||
"definition": {"dynamicRegistration": True},
|
||||
"documentSymbol": {
|
||||
"dynamicRegistration": True,
|
||||
"hierarchicalDocumentSymbolSupport": True,
|
||||
"symbolKind": {
|
||||
"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
|
||||
},
|
||||
"symbolKind": {"valueSet": list(range(1, 27))},
|
||||
},
|
||||
},
|
||||
"workspace": {"workspaceFolders": True, "didChangeConfiguration": {"dynamicRegistration": True}},
|
||||
|
||||
@@ -112,7 +112,6 @@ class Intelephense(SolidLanguageServer):
|
||||
"capabilities": {
|
||||
"textDocument": {
|
||||
"synchronization": {"didSave": True, "dynamicRegistration": True},
|
||||
"completion": {"dynamicRegistration": True, "completionItem": {"snippetSupport": True}},
|
||||
"definition": {"dynamicRegistration": True},
|
||||
},
|
||||
"workspace": {"workspaceFolders": True, "didChangeConfiguration": {"dynamicRegistration": True}},
|
||||
|
||||
@@ -188,9 +188,7 @@ class KotlinLanguageServer(SolidLanguageServer):
|
||||
"didChangeWatchedFiles": {"dynamicRegistration": True, "relativePatternSupport": True},
|
||||
"symbol": {
|
||||
"dynamicRegistration": True,
|
||||
"symbolKind": {
|
||||
"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
|
||||
},
|
||||
"symbolKind": {"valueSet": list(range(1, 27))},
|
||||
"tagSupport": {"valueSet": [1]},
|
||||
"resolveSupport": {"properties": ["location.range"]},
|
||||
},
|
||||
@@ -257,9 +255,7 @@ class KotlinLanguageServer(SolidLanguageServer):
|
||||
"documentHighlight": {"dynamicRegistration": True},
|
||||
"documentSymbol": {
|
||||
"dynamicRegistration": True,
|
||||
"symbolKind": {
|
||||
"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
|
||||
},
|
||||
"symbolKind": {"valueSet": list(range(1, 27))},
|
||||
"hierarchicalDocumentSymbolSupport": True,
|
||||
"tagSupport": {"valueSet": [1]},
|
||||
"labelSupport": True,
|
||||
|
||||
@@ -68,34 +68,17 @@ class PyrightServer(SolidLanguageServer):
|
||||
},
|
||||
"capabilities": {
|
||||
"workspace": {
|
||||
"applyEdit": True,
|
||||
"workspaceEdit": {"documentChanges": True},
|
||||
"didChangeConfiguration": {"dynamicRegistration": True},
|
||||
"didChangeWatchedFiles": {"dynamicRegistration": True},
|
||||
"symbol": {
|
||||
"dynamicRegistration": True,
|
||||
"symbolKind": {
|
||||
"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
|
||||
},
|
||||
"symbolKind": {"valueSet": list(range(1, 27))},
|
||||
},
|
||||
"executeCommand": {"dynamicRegistration": True},
|
||||
},
|
||||
"textDocument": {
|
||||
"synchronization": {"dynamicRegistration": True, "willSave": True, "willSaveWaitUntil": True, "didSave": True},
|
||||
"completion": {
|
||||
"dynamicRegistration": True,
|
||||
"contextSupport": True,
|
||||
"completionItem": {
|
||||
"snippetSupport": True,
|
||||
"commitCharactersSupport": True,
|
||||
"documentationFormat": ["markdown", "plaintext"],
|
||||
"deprecatedSupport": True,
|
||||
"preselectSupport": True,
|
||||
},
|
||||
"completionItemKind": {
|
||||
"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
|
||||
},
|
||||
},
|
||||
"hover": {"dynamicRegistration": True, "contentFormat": ["markdown", "plaintext"]},
|
||||
"signatureHelp": {
|
||||
"dynamicRegistration": True,
|
||||
@@ -106,36 +89,11 @@ class PyrightServer(SolidLanguageServer):
|
||||
},
|
||||
"definition": {"dynamicRegistration": True},
|
||||
"references": {"dynamicRegistration": True},
|
||||
"documentHighlight": {"dynamicRegistration": True},
|
||||
"documentSymbol": {
|
||||
"dynamicRegistration": True,
|
||||
"symbolKind": {
|
||||
"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
|
||||
},
|
||||
"symbolKind": {"valueSet": list(range(1, 27))},
|
||||
"hierarchicalDocumentSymbolSupport": True,
|
||||
},
|
||||
"codeAction": {
|
||||
"dynamicRegistration": True,
|
||||
"codeActionLiteralSupport": {
|
||||
"codeActionKind": {
|
||||
"valueSet": [
|
||||
"",
|
||||
"quickfix",
|
||||
"refactor",
|
||||
"refactor.extract",
|
||||
"refactor.inline",
|
||||
"refactor.rewrite",
|
||||
"source",
|
||||
"source.organizeImports",
|
||||
]
|
||||
}
|
||||
},
|
||||
},
|
||||
"codeLens": {"dynamicRegistration": True},
|
||||
"formatting": {"dynamicRegistration": True},
|
||||
"rangeFormatting": {"dynamicRegistration": True},
|
||||
"onTypeFormatting": {"dynamicRegistration": True},
|
||||
"rename": {"dynamicRegistration": True},
|
||||
"publishDiagnostics": {"relatedInformation": True},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -121,9 +121,7 @@ class RustAnalyzer(SolidLanguageServer):
|
||||
"didChangeWatchedFiles": {"dynamicRegistration": True, "relativePatternSupport": True},
|
||||
"symbol": {
|
||||
"dynamicRegistration": True,
|
||||
"symbolKind": {
|
||||
"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
|
||||
},
|
||||
"symbolKind": {"valueSet": list(range(1, 27))},
|
||||
"tagSupport": {"valueSet": [1]},
|
||||
"resolveSupport": {"properties": ["location.range"]},
|
||||
},
|
||||
@@ -190,9 +188,7 @@ class RustAnalyzer(SolidLanguageServer):
|
||||
"documentHighlight": {"dynamicRegistration": True},
|
||||
"documentSymbol": {
|
||||
"dynamicRegistration": True,
|
||||
"symbolKind": {
|
||||
"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
|
||||
},
|
||||
"symbolKind": {"valueSet": list(range(1, 27))},
|
||||
"hierarchicalDocumentSymbolSupport": True,
|
||||
"tagSupport": {"valueSet": [1]},
|
||||
"labelSupport": True,
|
||||
|
||||
@@ -116,7 +116,6 @@ class Solargraph(SolidLanguageServer):
|
||||
}
|
||||
],
|
||||
}
|
||||
|
||||
return initialize_params
|
||||
|
||||
def _start_server(self):
|
||||
|
||||
@@ -140,472 +140,40 @@ class TypeScriptLanguageServer(SolidLanguageServer):
|
||||
"""
|
||||
Returns the initialize params for the TypeScript Language Server.
|
||||
"""
|
||||
root_uri = pathlib.Path(repository_absolute_path).as_uri()
|
||||
initialize_params = {
|
||||
"locale": "en",
|
||||
"rootPath": "$rootPath",
|
||||
"rootUri": "$rootUri",
|
||||
"capabilities": {
|
||||
"workspace": {
|
||||
"applyEdit": True,
|
||||
"workspaceEdit": {
|
||||
"documentChanges": True,
|
||||
"resourceOperations": ["create", "rename", "delete"],
|
||||
"failureHandling": "textOnlyTransactional",
|
||||
"normalizesLineEndings": True,
|
||||
"changeAnnotationSupport": {"groupsOnLabel": True},
|
||||
},
|
||||
"configuration": True,
|
||||
"didChangeWatchedFiles": {"dynamicRegistration": True, "relativePatternSupport": True},
|
||||
"symbol": {
|
||||
"dynamicRegistration": True,
|
||||
"symbolKind": {
|
||||
"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
|
||||
},
|
||||
"tagSupport": {"valueSet": [1]},
|
||||
"resolveSupport": {"properties": ["location.range"]},
|
||||
},
|
||||
"codeLens": {"refreshSupport": True},
|
||||
"executeCommand": {"dynamicRegistration": True},
|
||||
"didChangeConfiguration": {"dynamicRegistration": True},
|
||||
"workspaceFolders": True,
|
||||
"semanticTokens": {"refreshSupport": True},
|
||||
"fileOperations": {
|
||||
"dynamicRegistration": True,
|
||||
"didCreate": True,
|
||||
"didRename": True,
|
||||
"didDelete": True,
|
||||
"willCreate": True,
|
||||
"willRename": True,
|
||||
"willDelete": True,
|
||||
},
|
||||
"inlineValue": {"refreshSupport": True},
|
||||
"inlayHint": {"refreshSupport": True},
|
||||
"diagnostics": {"refreshSupport": True},
|
||||
},
|
||||
"textDocument": {
|
||||
"publishDiagnostics": {
|
||||
"relatedInformation": True,
|
||||
"versionSupport": False,
|
||||
"tagSupport": {"valueSet": [1, 2]},
|
||||
"codeDescriptionSupport": True,
|
||||
"dataSupport": True,
|
||||
},
|
||||
"synchronization": {"dynamicRegistration": True, "willSave": True, "willSaveWaitUntil": True, "didSave": True},
|
||||
"completion": {
|
||||
"dynamicRegistration": True,
|
||||
"contextSupport": True,
|
||||
"completionItem": {
|
||||
"snippetSupport": True,
|
||||
"commitCharactersSupport": True,
|
||||
"documentationFormat": ["markdown", "plaintext"],
|
||||
"deprecatedSupport": True,
|
||||
"preselectSupport": True,
|
||||
"tagSupport": {"valueSet": [1]},
|
||||
"insertReplaceSupport": True,
|
||||
"resolveSupport": {"properties": ["documentation", "detail", "additionalTextEdits"]},
|
||||
"insertTextModeSupport": {"valueSet": [1, 2]},
|
||||
"labelDetailsSupport": True,
|
||||
},
|
||||
"insertTextMode": 2,
|
||||
"completionItemKind": {
|
||||
"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
|
||||
},
|
||||
"completionList": {"itemDefaults": ["commitCharacters", "editRange", "insertTextFormat", "insertTextMode"]},
|
||||
},
|
||||
"hover": {"dynamicRegistration": True, "contentFormat": ["markdown", "plaintext"]},
|
||||
"signatureHelp": {
|
||||
"dynamicRegistration": True,
|
||||
"signatureInformation": {
|
||||
"documentationFormat": ["markdown", "plaintext"],
|
||||
"parameterInformation": {"labelOffsetSupport": True},
|
||||
"activeParameterSupport": True,
|
||||
},
|
||||
"contextSupport": True,
|
||||
},
|
||||
"definition": {"dynamicRegistration": True, "linkSupport": True},
|
||||
"synchronization": {"didSave": True, "dynamicRegistration": True},
|
||||
"completion": {"dynamicRegistration": True, "completionItem": {"snippetSupport": True}},
|
||||
"definition": {"dynamicRegistration": True},
|
||||
"references": {"dynamicRegistration": True},
|
||||
"documentHighlight": {"dynamicRegistration": True},
|
||||
"documentSymbol": {
|
||||
"dynamicRegistration": True,
|
||||
"symbolKind": {
|
||||
"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
|
||||
},
|
||||
"hierarchicalDocumentSymbolSupport": True,
|
||||
"tagSupport": {"valueSet": [1]},
|
||||
"labelSupport": True,
|
||||
"symbolKind": {"valueSet": list(range(1, 27))},
|
||||
},
|
||||
"codeAction": {
|
||||
"dynamicRegistration": True,
|
||||
"isPreferredSupport": True,
|
||||
"disabledSupport": True,
|
||||
"dataSupport": True,
|
||||
"resolveSupport": {"properties": ["edit"]},
|
||||
"codeActionLiteralSupport": {
|
||||
"codeActionKind": {
|
||||
"valueSet": [
|
||||
"",
|
||||
"quickfix",
|
||||
"refactor",
|
||||
"refactor.extract",
|
||||
"refactor.inline",
|
||||
"refactor.rewrite",
|
||||
"source",
|
||||
"source.organizeImports",
|
||||
]
|
||||
}
|
||||
},
|
||||
"honorsChangeAnnotations": False,
|
||||
},
|
||||
"codeLens": {"dynamicRegistration": True},
|
||||
"formatting": {"dynamicRegistration": True},
|
||||
"rangeFormatting": {"dynamicRegistration": True},
|
||||
"onTypeFormatting": {"dynamicRegistration": True},
|
||||
"rename": {
|
||||
"dynamicRegistration": True,
|
||||
"prepareSupport": True,
|
||||
"prepareSupportDefaultBehavior": 1,
|
||||
"honorsChangeAnnotations": True,
|
||||
},
|
||||
"documentLink": {"dynamicRegistration": True, "tooltipSupport": True},
|
||||
"typeDefinition": {"dynamicRegistration": True, "linkSupport": True},
|
||||
"implementation": {"dynamicRegistration": True, "linkSupport": True},
|
||||
"colorProvider": {"dynamicRegistration": True},
|
||||
"foldingRange": {
|
||||
"dynamicRegistration": True,
|
||||
"rangeLimit": 5000,
|
||||
"lineFoldingOnly": True,
|
||||
"foldingRangeKind": {"valueSet": ["comment", "imports", "region"]},
|
||||
"foldingRange": {"collapsedText": False},
|
||||
},
|
||||
"declaration": {"dynamicRegistration": True, "linkSupport": True},
|
||||
"selectionRange": {"dynamicRegistration": True},
|
||||
"callHierarchy": {"dynamicRegistration": True},
|
||||
"semanticTokens": {
|
||||
"dynamicRegistration": True,
|
||||
"tokenTypes": [
|
||||
"namespace",
|
||||
"type",
|
||||
"class",
|
||||
"enum",
|
||||
"interface",
|
||||
"struct",
|
||||
"typeParameter",
|
||||
"parameter",
|
||||
"variable",
|
||||
"property",
|
||||
"enumMember",
|
||||
"event",
|
||||
"function",
|
||||
"method",
|
||||
"macro",
|
||||
"keyword",
|
||||
"modifier",
|
||||
"comment",
|
||||
"string",
|
||||
"number",
|
||||
"regexp",
|
||||
"operator",
|
||||
"decorator",
|
||||
],
|
||||
"tokenModifiers": [
|
||||
"declaration",
|
||||
"definition",
|
||||
"readonly",
|
||||
"static",
|
||||
"deprecated",
|
||||
"abstract",
|
||||
"async",
|
||||
"modification",
|
||||
"documentation",
|
||||
"defaultLibrary",
|
||||
],
|
||||
"formats": ["relative"],
|
||||
"requests": {"range": True, "full": {"delta": True}},
|
||||
"multilineTokenSupport": False,
|
||||
"overlappingTokenSupport": False,
|
||||
"serverCancelSupport": True,
|
||||
"augmentsSyntaxTokens": False,
|
||||
},
|
||||
"linkedEditingRange": {"dynamicRegistration": True},
|
||||
"typeHierarchy": {"dynamicRegistration": True},
|
||||
"inlineValue": {"dynamicRegistration": True},
|
||||
"inlayHint": {
|
||||
"dynamicRegistration": True,
|
||||
"resolveSupport": {"properties": ["tooltip", "textEdits", "label.tooltip", "label.location", "label.command"]},
|
||||
},
|
||||
"diagnostic": {"dynamicRegistration": True, "relatedDocumentSupport": False},
|
||||
"hover": {"dynamicRegistration": True, "contentFormat": ["markdown", "plaintext"]},
|
||||
"signatureHelp": {"dynamicRegistration": True},
|
||||
"codeAction": {"dynamicRegistration": True},
|
||||
},
|
||||
"general": {
|
||||
"staleRequestSupport": {
|
||||
"cancel": True,
|
||||
"retryOnContentModified": [
|
||||
"textDocument/semanticTokens/full",
|
||||
"textDocument/semanticTokens/range",
|
||||
"textDocument/semanticTokens/full/delta",
|
||||
],
|
||||
},
|
||||
"regularExpressions": {"engine": "ECMAScript", "version": "ES2020"},
|
||||
"markdown": {
|
||||
"parser": "marked",
|
||||
"version": "1.1.0",
|
||||
"allowedTags": [
|
||||
"ul",
|
||||
"li",
|
||||
"p",
|
||||
"code",
|
||||
"blockquote",
|
||||
"ol",
|
||||
"h1",
|
||||
"h2",
|
||||
"h3",
|
||||
"h4",
|
||||
"h5",
|
||||
"h6",
|
||||
"hr",
|
||||
"em",
|
||||
"pre",
|
||||
"table",
|
||||
"thead",
|
||||
"tbody",
|
||||
"tr",
|
||||
"th",
|
||||
"td",
|
||||
"div",
|
||||
"del",
|
||||
"a",
|
||||
"strong",
|
||||
"br",
|
||||
"img",
|
||||
"span",
|
||||
],
|
||||
},
|
||||
"positionEncodings": ["utf-16"],
|
||||
},
|
||||
"notebookDocument": {"synchronization": {"dynamicRegistration": True, "executionSummarySupport": True}},
|
||||
"experimental": {
|
||||
"snippetTextEdit": True,
|
||||
"codeActionGroup": True,
|
||||
"hoverActions": True,
|
||||
"serverStatusNotification": True,
|
||||
"colorDiagnosticOutput": True,
|
||||
"openServerLogs": True,
|
||||
"localDocs": True,
|
||||
"commands": {
|
||||
"commands": [
|
||||
"rust-analyzer.runSingle",
|
||||
"rust-analyzer.debugSingle",
|
||||
"rust-analyzer.showReferences",
|
||||
"rust-analyzer.gotoLocation",
|
||||
"editor.action.triggerParameterHints",
|
||||
]
|
||||
},
|
||||
"workspace": {
|
||||
"workspaceFolders": True,
|
||||
"didChangeConfiguration": {"dynamicRegistration": True},
|
||||
"symbol": {"dynamicRegistration": True},
|
||||
},
|
||||
},
|
||||
"initializationOptions": {
|
||||
"cargoRunner": None,
|
||||
"runnables": {"extraEnv": None, "problemMatcher": ["$rustc"], "command": None, "extraArgs": []},
|
||||
"statusBar": {"clickAction": "openLogs"},
|
||||
"server": {"path": None, "extraEnv": None},
|
||||
"trace": {"server": "verbose", "extension": False},
|
||||
"debug": {
|
||||
"engine": "auto",
|
||||
"sourceFileMap": {"/rustc/<id>": "${env:USERPROFILE}/.rustup/toolchains/<toolchain-id>/lib/rustlib/src/rust"},
|
||||
"openDebugPane": False,
|
||||
"engineSettings": {},
|
||||
},
|
||||
"restartServerOnConfigChange": False,
|
||||
"typing": {"continueCommentsOnNewline": True, "autoClosingAngleBrackets": {"enable": False}},
|
||||
"diagnostics": {
|
||||
"previewRustcOutput": False,
|
||||
"useRustcErrorCode": False,
|
||||
"disabled": [],
|
||||
"enable": True,
|
||||
"experimental": {"enable": False},
|
||||
"remapPrefix": {},
|
||||
"warningsAsHint": [],
|
||||
"warningsAsInfo": [],
|
||||
},
|
||||
"discoverProjectRunner": None,
|
||||
"showUnlinkedFileNotification": True,
|
||||
"showDependenciesExplorer": True,
|
||||
"assist": {"emitMustUse": False, "expressionFillDefault": "todo"},
|
||||
"cachePriming": {"enable": True, "numThreads": 0},
|
||||
"cargo": {
|
||||
"autoreload": True,
|
||||
"buildScripts": {
|
||||
"enable": True,
|
||||
"invocationLocation": "workspace",
|
||||
"invocationStrategy": "per_workspace",
|
||||
"overrideCommand": None,
|
||||
"useRustcWrapper": True,
|
||||
},
|
||||
"cfgs": {},
|
||||
"extraArgs": [],
|
||||
"extraEnv": {},
|
||||
"features": [],
|
||||
"noDefaultFeatures": False,
|
||||
"sysroot": "discover",
|
||||
"sysrootSrc": None,
|
||||
"target": None,
|
||||
"unsetTest": ["core"],
|
||||
},
|
||||
"checkOnSave": True,
|
||||
"check": {
|
||||
"allTargets": True,
|
||||
"command": "check",
|
||||
"extraArgs": [],
|
||||
"extraEnv": {},
|
||||
"features": None,
|
||||
"ignore": [],
|
||||
"invocationLocation": "workspace",
|
||||
"invocationStrategy": "per_workspace",
|
||||
"noDefaultFeatures": None,
|
||||
"overrideCommand": None,
|
||||
"targets": None,
|
||||
},
|
||||
"completion": {
|
||||
"autoimport": {"enable": True},
|
||||
"autoself": {"enable": True},
|
||||
"callable": {"snippets": "fill_arguments"},
|
||||
"fullFunctionSignatures": {"enable": False},
|
||||
"limit": None,
|
||||
"postfix": {"enable": True},
|
||||
"privateEditable": {"enable": False},
|
||||
"snippets": {
|
||||
"custom": {
|
||||
"Arc::new": {
|
||||
"postfix": "arc",
|
||||
"body": "Arc::new(${receiver})",
|
||||
"requires": "std::sync::Arc",
|
||||
"description": "Put the expression into an `Arc`",
|
||||
"scope": "expr",
|
||||
},
|
||||
"Rc::new": {
|
||||
"postfix": "rc",
|
||||
"body": "Rc::new(${receiver})",
|
||||
"requires": "std::rc::Rc",
|
||||
"description": "Put the expression into an `Rc`",
|
||||
"scope": "expr",
|
||||
},
|
||||
"Box::pin": {
|
||||
"postfix": "pinbox",
|
||||
"body": "Box::pin(${receiver})",
|
||||
"requires": "std::boxed::Box",
|
||||
"description": "Put the expression into a pinned `Box`",
|
||||
"scope": "expr",
|
||||
},
|
||||
"Ok": {
|
||||
"postfix": "ok",
|
||||
"body": "Ok(${receiver})",
|
||||
"description": "Wrap the expression in a `Result::Ok`",
|
||||
"scope": "expr",
|
||||
},
|
||||
"Err": {
|
||||
"postfix": "err",
|
||||
"body": "Err(${receiver})",
|
||||
"description": "Wrap the expression in a `Result::Err`",
|
||||
"scope": "expr",
|
||||
},
|
||||
"Some": {
|
||||
"postfix": "some",
|
||||
"body": "Some(${receiver})",
|
||||
"description": "Wrap the expression in an `Option::Some`",
|
||||
"scope": "expr",
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
"files": {"excludeDirs": [], "watcher": "client"},
|
||||
"highlightRelated": {
|
||||
"breakPoints": {"enable": True},
|
||||
"closureCaptures": {"enable": True},
|
||||
"exitPoints": {"enable": True},
|
||||
"references": {"enable": True},
|
||||
"yieldPoints": {"enable": True},
|
||||
},
|
||||
"hover": {
|
||||
"actions": {
|
||||
"debug": {"enable": True},
|
||||
"enable": True,
|
||||
"gotoTypeDef": {"enable": True},
|
||||
"implementations": {"enable": True},
|
||||
"references": {"enable": False},
|
||||
"run": {"enable": True},
|
||||
},
|
||||
"documentation": {"enable": True, "keywords": {"enable": True}},
|
||||
"links": {"enable": True},
|
||||
"memoryLayout": {"alignment": "hexadecimal", "enable": True, "niches": False, "offset": "hexadecimal", "size": "both"},
|
||||
},
|
||||
"imports": {
|
||||
"granularity": {"enforce": False, "group": "crate"},
|
||||
"group": {"enable": True},
|
||||
"merge": {"glob": True},
|
||||
"preferNoStd": False,
|
||||
"preferPrelude": False,
|
||||
"prefix": "plain",
|
||||
},
|
||||
"inlayHints": {
|
||||
"bindingModeHints": {"enable": False},
|
||||
"chainingHints": {"enable": True},
|
||||
"closingBraceHints": {"enable": True, "minLines": 25},
|
||||
"closureCaptureHints": {"enable": False},
|
||||
"closureReturnTypeHints": {"enable": "never"},
|
||||
"closureStyle": "impl_fn",
|
||||
"discriminantHints": {"enable": "never"},
|
||||
"expressionAdjustmentHints": {"enable": "never", "hideOutsideUnsafe": False, "mode": "prefix"},
|
||||
"lifetimeElisionHints": {"enable": "never", "useParameterNames": False},
|
||||
"maxLength": 25,
|
||||
"parameterHints": {"enable": True},
|
||||
"reborrowHints": {"enable": "never"},
|
||||
"renderColons": True,
|
||||
"typeHints": {"enable": True, "hideClosureInitialization": False, "hideNamedConstructor": False},
|
||||
},
|
||||
"interpret": {"tests": False},
|
||||
"joinLines": {"joinAssignments": True, "joinElseIf": True, "removeTrailingComma": True, "unwrapTrivialBlock": True},
|
||||
"lens": {
|
||||
"debug": {"enable": True},
|
||||
"enable": True,
|
||||
"forceCustomCommands": True,
|
||||
"implementations": {"enable": True},
|
||||
"location": "above_name",
|
||||
"references": {
|
||||
"adt": {"enable": False},
|
||||
"enumVariant": {"enable": False},
|
||||
"method": {"enable": False},
|
||||
"trait": {"enable": False},
|
||||
},
|
||||
"run": {"enable": True},
|
||||
},
|
||||
"linkedProjects": [],
|
||||
"lru": {"capacity": None, "query": {"capacities": {}}},
|
||||
"notifications": {"cargoTomlNotFound": True},
|
||||
"numThreads": None,
|
||||
"procMacro": {"attributes": {"enable": True}, "enable": True, "ignored": {}, "server": None},
|
||||
"references": {"excludeImports": False},
|
||||
"rust": {"analyzerTargetDir": None},
|
||||
"rustc": {"source": None},
|
||||
"rustfmt": {"extraArgs": [], "overrideCommand": None, "rangeFormatting": {"enable": False}},
|
||||
"semanticHighlighting": {
|
||||
"doc": {"comment": {"inject": {"enable": True}}},
|
||||
"nonStandardTokens": True,
|
||||
"operator": {"enable": True, "specialization": {"enable": False}},
|
||||
"punctuation": {"enable": False, "separate": {"macro": {"bang": False}}, "specialization": {"enable": False}},
|
||||
"strings": {"enable": True},
|
||||
},
|
||||
"signatureInfo": {"detail": "full", "documentation": {"enable": True}},
|
||||
"workspace": {"symbol": {"search": {"kind": "only_types", "limit": 128, "scope": "workspace"}}},
|
||||
},
|
||||
"trace": "verbose",
|
||||
"workspaceFolders": [{"uri": "$uri", "name": "$name"}],
|
||||
"processId": os.getpid(),
|
||||
"rootPath": repository_absolute_path,
|
||||
"rootUri": root_uri,
|
||||
"workspaceFolders": [
|
||||
{
|
||||
"uri": root_uri,
|
||||
"name": os.path.basename(repository_absolute_path),
|
||||
}
|
||||
],
|
||||
}
|
||||
|
||||
root_uri = pathlib.Path(repository_absolute_path).as_uri()
|
||||
initialize_params["processId"] = os.getpid()
|
||||
initialize_params["rootPath"] = repository_absolute_path
|
||||
initialize_params["rootUri"] = root_uri
|
||||
initialize_params["workspaceFolders"][0]["uri"] = root_uri
|
||||
initialize_params["workspaceFolders"][0]["name"] = os.path.basename(repository_absolute_path)
|
||||
|
||||
return initialize_params
|
||||
|
||||
def _start_server(self):
|
||||
|
||||
Reference in New Issue
Block a user