Skip to content

Commit 6da1d74

Browse files
committed
update readme, update python packages and tsconfig
1 parent 9417716 commit 6da1d74

File tree

9 files changed

+46
-58
lines changed

9 files changed

+46
-58
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ exclude =
1111
external
1212
playground
1313

14-
ignore = N805,W503
14+
ignore = N805,W503,N818
1515
per-file-ignores=__init__.py:F401,F403
1616

.vscode/extensions.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
// See http://go.microsoft.com/fwlink/?LinkId=827846
33
// for the documentation about the extensions.json format
44
"recommendations": [
5-
"dbaeumer.vscode-eslint",
65
"ms-python.python",
7-
"ms-python.vscode-pylance"
6+
"ms-python.vscode-pylance",
7+
"esbenp.prettier-vscode",
8+
"dbaeumer.vscode-eslint"
89
]
9-
}
10+
}

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Robot Code Readme
22

3-
Language Server and client for Visual Studio Code.
3+
RobotFramework Language Server and client for Visual Studio Code.
4+
45

56
## Requirements
67

7-
* Python 3.8 or above
8+
* Python 3.9 or above
89
* Robotframework 4.0 and above
10+
* VSCode version 1.58 and above
911

1012
## Installation
1113

mypy.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
# File reference here - http://mypy.readthedocs.io/en/latest/config_file.html#config-file
33

44
[mypy]
5+
python_version = 3.9
56
plugins = pydantic.mypy
6-
7+
exclude = robotcode/external/|dist|node_modules
78
warn_redundant_casts = True
89
warn_unused_ignores = True
910
strict = True
@@ -13,7 +14,7 @@ strict = True
1314

1415
ignore_missing_imports = True
1516

16-
[mypy-*]
17+
[mypy-*]
1718
; disallow_untyped_calls = True
1819
; disallow_untyped_defs = True
1920
; check_untyped_defs = True

pyproject.toml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,26 @@ include = ["robotcode/py.typed", "README.md"]
77
exclude = ["robotcode/external"]
88

99
[tool.poetry.dependencies]
10-
python = "^3.8"
10+
python = "^3.9"
1111
robotframework = "^4.0.0"
1212

1313

1414
[tool.poetry.dev-dependencies]
15-
pydantic = "^1.7.3"
16-
isort = "^5.7.0"
17-
mypy = "^0.790"
18-
flake8 = "^3.8.4"
19-
black = "^20.8b1"
20-
pep8-naming = "^0.11.1"
21-
debugpy = "^1.2.1"
22-
pytest = "^6.2.1"
23-
pytest-asyncio = "^0.14.0"
24-
pytest-cov = "^2.11.1"
25-
coverage = { extras = ["toml"], version = "^5.5" }
26-
coloredlogs = "^15.0"
15+
pydantic = "^1.8.2"
16+
isort = "^5.9.2"
17+
mypy = "^0.910"
18+
flake8 = "^3.9.2"
19+
black = "^21.6b0"
20+
pep8-naming = "^0.12.0"
21+
debugpy = "^1.3.0"
22+
pytest = "^6.2.4"
23+
pytest-asyncio = "^0.15.1"
24+
pytest-cov = "^2.12.1"
25+
coverage = "^5.5"
26+
coloredlogs = "^15.0.1"
2727
robotremoteserver = "^1.1"
28-
Cython = "^0.29.22"
29-
robotframework-robocop = "^1.7.0"
28+
Cython = "^0.29.24"
29+
robotframework-robocop = "^1.7.1"
3030

3131

3232
[tool.poetry-dynamic-versioning]
@@ -56,9 +56,7 @@ exclude = '''
5656
| \.git # root of the project
5757
| \.mypy_cache
5858
| \.tox
59-
| \.venv
60-
| _build
61-
| buck-out
59+
| \.venv
6260
| build
6361
| dist
6462
| out

robotcode/jsonrpc2/protocol.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"JsonRPCProtocol",
4949
"JsonRPCException",
5050
"JsonRPCParseError",
51-
"InvalidProtocolVersionException",
51+
"InvalidProtocolVersionError",
5252
"rpc_method",
5353
"RpcRegistry",
5454
"JsonRPCProtocolPart",
@@ -122,7 +122,7 @@ class JsonRPCParseError(JsonRPCException):
122122
pass
123123

124124

125-
class InvalidProtocolVersionException(JsonRPCParseError):
125+
class InvalidProtocolVersionError(JsonRPCParseError):
126126
pass
127127

128128

@@ -434,7 +434,7 @@ def _generate_json_rpc_messages_from_dict(
434434
def inner(d: Dict[Any, Any]) -> JsonRPCMessage:
435435
if "jsonrpc" in d:
436436
if d["jsonrpc"] != PROTOCOL_VERSION:
437-
raise InvalidProtocolVersionException("Invalid JSON-RPC2 protocol version.")
437+
raise InvalidProtocolVersionError("Invalid JSON-RPC2 protocol version.")
438438

439439
if "id" in d:
440440
if "method" in d:

robotcode/language_server/common/types.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -580,22 +580,6 @@ class SaveOptions(Model):
580580

581581

582582
class TextDocumentSyncOptions(Model):
583-
def __init__(
584-
self,
585-
open_close: Optional[bool] = None,
586-
change: Optional[TextDocumentSyncKind] = None,
587-
will_save: Optional[bool] = None,
588-
will_save_wait_until: Optional[bool] = None,
589-
save: Union[bool, SaveOptions, None] = None,
590-
) -> None:
591-
super().__init__( # type: ignore
592-
open_close=open_close,
593-
change=change,
594-
will_save=will_save,
595-
will_save_wait_until=will_save_wait_until,
596-
save=save,
597-
)
598-
599583
open_close: Optional[bool] = None
600584
change: Optional[TextDocumentSyncKind] = None
601585
will_save: Optional[bool] = None

robotcode/language_server/robotframework/diagnostics/namespace.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@
4949
DIAGNOSTICS_SOURCE_NAME = "RobotCode"
5050

5151

52-
class DiagnosticsException(Exception):
52+
class DiagnosticsError(Exception):
5353
pass
5454

5555

56-
class DiagnosticsWarning(DiagnosticsException):
56+
class DiagnosticsWarningError(DiagnosticsError):
5757
pass
5858

5959

60-
class ImportError(DiagnosticsException):
60+
class ImportError(DiagnosticsError):
6161
pass
6262

6363

@@ -810,7 +810,7 @@ async def _import(value: Import) -> Optional[LibraryEntry]:
810810
# result.import_source = value.source
811811
pass
812812
else:
813-
raise DiagnosticsException("Unknown import type.")
813+
raise DiagnosticsError("Unknown import type.")
814814

815815
if top_level and result is not None:
816816
if result.library_doc.source is not None and result.library_doc.errors:
@@ -1122,7 +1122,7 @@ class DiagnosticsEntry(NamedTuple):
11221122
code: Optional[str] = None
11231123

11241124

1125-
class CancelSearch(Exception):
1125+
class CancelSearchError(Exception):
11261126
pass
11271127

11281128

@@ -1143,20 +1143,20 @@ async def find_keyword(self, name: Optional[str]) -> Optional[KeywordDoc]:
11431143
)
11441144

11451145
return result
1146-
except CancelSearch:
1146+
except CancelSearchError:
11471147
return None
11481148

11491149
async def _find_keyword(self, name: Optional[str]) -> Optional[KeywordDoc]:
11501150
if not name:
11511151
self.diagnostics.append(
11521152
DiagnosticsEntry("Keyword name cannot be empty.", DiagnosticSeverity.ERROR, "KeywordError")
11531153
)
1154-
raise CancelSearch()
1154+
raise CancelSearchError()
11551155
if not isinstance(name, str):
11561156
self.diagnostics.append(
11571157
DiagnosticsEntry("Keyword name must be a string.", DiagnosticSeverity.ERROR, "KeywordError")
11581158
)
1159-
raise CancelSearch()
1159+
raise CancelSearchError()
11601160

11611161
result = await self._get_keyword_from_self(name)
11621162
if not result and "." in name:
@@ -1191,7 +1191,7 @@ async def _get_explicit_keyword(self, name: str) -> Optional[KeywordDoc]:
11911191
"KeywordError",
11921192
)
11931193
)
1194-
raise CancelSearch()
1194+
raise CancelSearchError()
11951195

11961196
return found[0][1] if found else None
11971197

@@ -1240,7 +1240,7 @@ async def _get_keyword_from_resource_files(self, name: str) -> Optional[KeywordD
12401240
"KeywordError",
12411241
)
12421242
)
1243-
raise CancelSearch()
1243+
raise CancelSearchError()
12441244

12451245
async def _get_keyword_based_on_search_order(
12461246
self, entries: List[Tuple[LibraryEntry, KeywordDoc]]
@@ -1276,7 +1276,7 @@ async def _get_keyword_from_libraries(self, name: str) -> Optional[KeywordDoc]:
12761276
"KeywordError",
12771277
)
12781278
)
1279-
raise CancelSearch()
1279+
raise CancelSearchError()
12801280

12811281
async def _filter_stdlib_runner(
12821282
self, entry1: Tuple[LibraryEntry, KeywordDoc], entry2: Tuple[LibraryEntry, KeywordDoc]

tsconfig.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
"compilerOptions": {
33
"baseUrl": ".",
44
"module": "commonjs",
5-
"target": "es2018",
5+
"moduleResolution": "Node",
6+
"target": "ES2021",
67
"outDir": "out",
7-
"lib": ["es6", "es2018", "dom", "ES2019", "ES2020"],
8+
"lib": ["es6", "dom", "ES2018", "ES2019", "ES2020"],
89
"sourceMap": true,
910
"rootDir": "vscode-client",
1011
"strict": true,
1112
"experimentalDecorators": true,
13+
"emitDecoratorMetadata": true,
1214
//"esModuleInterop": true,
1315
//"allowSyntheticDefaultImports": true,
1416
"noImplicitAny": true,

0 commit comments

Comments
 (0)