-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3fb2531
commit b5cac85
Showing
13 changed files
with
670 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
fmt: | ||
poetry run ruff --fix ./ruff_lsp | ||
poetry run black ./ruff_lsp | ||
poetry run ruff --fix ./ruff_lsp ./tests | ||
poetry run black ./ruff_lsp ./tests | ||
|
||
check: | ||
poetry run ruff ./ruff_lsp | ||
poetry run black --check ./ruff_lsp | ||
poetry run mypy ./ruff_lsp | ||
poetry run ruff ./ruff_lsp ./tests | ||
poetry run black --check ./ruff_lsp ./tests | ||
poetry run mypy ./ruff_lsp ./tests | ||
|
||
.PHONY: fmt check | ||
test: | ||
poetry run python -m unittest tests | ||
|
||
.PHONY: fmt check test |
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
"""Implementation of the LSP server for Ruff.""" | ||
|
||
|
||
from __future__ import annotations | ||
|
||
import copy | ||
|
Empty file.
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,2 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. |
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,8 @@ | ||
"""Constants for use with tests.""" | ||
from __future__ import annotations | ||
|
||
import pathlib | ||
|
||
TEST_ROOT = pathlib.Path(__file__).parent.parent | ||
TEST_DATA = TEST_ROOT / "data" | ||
PROJECT_ROOT = TEST_ROOT.parent |
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,216 @@ | ||
"""Default initialize request params.""" | ||
from __future__ import annotations | ||
|
||
import os | ||
|
||
from tests.client.constants import PROJECT_ROOT | ||
from tests.client.utils import as_uri | ||
|
||
VSCODE_DEFAULT_INITIALIZE = { | ||
"processId": os.getpid(), | ||
"clientInfo": {"name": "vscode", "version": "1.45.0"}, | ||
"rootPath": str(PROJECT_ROOT), | ||
"rootUri": as_uri(str(PROJECT_ROOT)), | ||
"capabilities": { | ||
"workspace": { | ||
"applyEdit": True, | ||
"workspaceEdit": { | ||
"documentChanges": True, | ||
"resourceOperations": ["create", "rename", "delete"], | ||
"failureHandling": "textOnlyTransactional", | ||
}, | ||
"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, | ||
] | ||
}, | ||
"tagSupport": {"valueSet": [1]}, | ||
}, | ||
"executeCommand": {"dynamicRegistration": True}, | ||
"configuration": True, | ||
"workspaceFolders": True, | ||
}, | ||
"textDocument": { | ||
"publishDiagnostics": { | ||
"relatedInformation": True, | ||
"versionSupport": False, | ||
"tagSupport": {"valueSet": [1, 2]}, | ||
"complexDiagnosticCodeSupport": 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, | ||
}, | ||
"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, | ||
"signatureInformation": { | ||
"documentationFormat": ["markdown", "plaintext"], | ||
"parameterInformation": {"labelOffsetSupport": True}, | ||
}, | ||
"contextSupport": True, | ||
}, | ||
"definition": {"dynamicRegistration": True, "linkSupport": 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]}, | ||
}, | ||
"codeAction": { | ||
"dynamicRegistration": True, | ||
"isPreferredSupport": 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, "prepareSupport": 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, | ||
}, | ||
"declaration": {"dynamicRegistration": True, "linkSupport": True}, | ||
"selectionRange": {"dynamicRegistration": True}, | ||
}, | ||
"window": {"workDoneProgress": True}, | ||
}, | ||
"trace": "verbose", | ||
"workspaceFolders": [{"uri": as_uri(str(PROJECT_ROOT)), "name": "my_project"}], | ||
"initializationOptions": {}, | ||
} |
Oops, something went wrong.