Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
predragnikolic committed Apr 16, 2024
1 parent c3bfbd7 commit 1bf6284
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 129 deletions.
2 changes: 1 addition & 1 deletion generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def generate(preferred_structure_kind: StructureKind, output: str) -> None:
])

content += '\n\n\n'
content += '\n\n'.join(generate_enumerations(lsp_json['enumerations'], ENUM_OVERRIDES))
content += '\n\n\n'.join(generate_enumerations(lsp_json['enumerations'], ENUM_OVERRIDES))
content += '\n\n'
content += '\n'.join(generate_type_aliases(lsp_json['typeAliases'], preferred_structure_kind))
content += '\n\n\n'
Expand Down
121 changes: 62 additions & 59 deletions lsp_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
RegExp = str


SemanticTokenTypesLiteral = Literal['namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator']
""" A set of predefined token types. This set is not fixed
an clients can specify additional token types via the
corresponding client capabilities.
@since 3.16.0 """


class SemanticTokenTypes(StrEnum):
""" A set of predefined token types. This set is not fixed
an clients can specify additional token types via the
Expand Down Expand Up @@ -46,8 +54,8 @@ class SemanticTokenTypes(StrEnum):
""" @since 3.17.0 """


SemanticTokenTypesLiteral = Literal['namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator']
""" A set of predefined token types. This set is not fixed
SemanticTokenModifiersLiteral = Literal['declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', 'modification', 'documentation', 'defaultLibrary']
""" A set of predefined token modifiers. This set is not fixed
an clients can specify additional token types via the
corresponding client capabilities.
Expand All @@ -72,12 +80,10 @@ class SemanticTokenModifiers(StrEnum):
DefaultLibrary = 'defaultLibrary'


SemanticTokenModifiersLiteral = Literal['declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', 'modification', 'documentation', 'defaultLibrary']
""" A set of predefined token modifiers. This set is not fixed
an clients can specify additional token types via the
corresponding client capabilities.
DocumentDiagnosticReportKindLiteral = Literal['full', 'unchanged']
""" The document diagnostic report kinds.
@since 3.16.0 """
@since 3.17.0 """


class DocumentDiagnosticReportKind(StrEnum):
Expand All @@ -92,12 +98,6 @@ class DocumentDiagnosticReportKind(StrEnum):
returned report is still accurate. """


DocumentDiagnosticReportKindLiteral = Literal['full', 'unchanged']
""" The document diagnostic report kinds.
@since 3.17.0 """


class ErrorCodes(IntEnum):
""" Predefined error codes. """
ParseError = -32700
Expand Down Expand Up @@ -139,6 +139,10 @@ class LSPErrorCodes(IntEnum):
the cancel. """


FoldingRangeKindLiteral = Literal['comment', 'imports', 'region']
""" A set of predefined range kinds. """


class FoldingRangeKind(StrEnum):
""" A set of predefined range kinds. """
Comment = 'comment'
Expand All @@ -149,10 +153,6 @@ class FoldingRangeKind(StrEnum):
""" Folding range for a region (e.g. `#region`) """


FoldingRangeKindLiteral = Literal['comment', 'imports', 'region']
""" A set of predefined range kinds. """


class SymbolKind(IntEnum):
""" A symbol kind. """
File = 1
Expand Down Expand Up @@ -191,6 +191,12 @@ class SymbolTag(IntEnum):
""" Render a symbol as obsolete, usually using a strike-out. """


UniquenessLevelLiteral = Literal['document', 'project', 'group', 'scheme', 'global']
""" Moniker uniqueness level to define scope of the moniker.
@since 3.16.0 """


class UniquenessLevel(StrEnum):
""" Moniker uniqueness level to define scope of the moniker.
Expand All @@ -207,8 +213,8 @@ class UniquenessLevel(StrEnum):
""" The moniker is globally unique """


UniquenessLevelLiteral = Literal['document', 'project', 'group', 'scheme', 'global']
""" Moniker uniqueness level to define scope of the moniker.
MonikerKindLiteral = Literal['import', 'export', 'local']
""" The moniker kind.
@since 3.16.0 """

Expand All @@ -226,12 +232,6 @@ class MonikerKind(StrEnum):
variable of a function, a class not visible outside the project, ...) """


MonikerKindLiteral = Literal['import', 'export', 'local']
""" The moniker kind.
@since 3.16.0 """


class InlayHintKind(IntEnum):
""" Inlay hint kinds.
Expand Down Expand Up @@ -369,6 +369,10 @@ class DocumentHighlightKind(IntEnum):
""" Write-access of a symbol, like writing to a variable. """


CodeActionKindLiteral = Literal['', 'quickfix', 'refactor', 'refactor.extract', 'refactor.inline', 'refactor.move', 'refactor.rewrite', 'source', 'source.organizeImports', 'source.fixAll', 'notebook']
""" A set of predefined code action kinds """


class CodeActionKind(StrEnum):
""" A set of predefined code action kinds """
Empty = ''
Expand Down Expand Up @@ -439,8 +443,7 @@ class CodeActionKind(StrEnum):
@since 3.18.0 """


CodeActionKindLiteral = Literal['', 'quickfix', 'refactor', 'refactor.extract', 'refactor.inline', 'refactor.move', 'refactor.rewrite', 'source', 'source.organizeImports', 'source.fixAll', 'notebook']
""" A set of predefined code action kinds """
TraceValueLiteral = Literal['off', 'messages', 'verbose']


class TraceValue(Enum):
Expand All @@ -452,7 +455,13 @@ class TraceValue(Enum):
""" Verbose message tracing. """


TraceValueLiteral = Literal['off', 'messages', 'verbose']
MarkupKindLiteral = Literal['plaintext', 'markdown']
""" Describes the content type that a client supports in various
result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
Please note that `MarkupKinds` must not start with a `$`. This kinds
are reserved for internal usage. """


class MarkupKind(StrEnum):
""" Describes the content type that a client supports in various
Expand All @@ -466,12 +475,10 @@ class MarkupKind(StrEnum):
""" Markdown is supported as a content format """


MarkupKindLiteral = Literal['plaintext', 'markdown']
""" Describes the content type that a client supports in various
result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
Please note that `MarkupKinds` must not start with a `$`. This kinds
are reserved for internal usage. """
LanguageKindLiteral = Literal['abap', 'bat', 'bibtex', 'clojure', 'coffeescript', 'c', 'cpp', 'csharp', 'css', 'd', 'pascal', 'diff', 'dart', 'dockerfile', 'elixir', 'erlang', 'fsharp', 'git-commit', 'rebase', 'go', 'groovy', 'handlebars', 'haskell', 'html', 'ini', 'java', 'javascript', 'javascriptreact', 'json', 'latex', 'less', 'lua', 'makefile', 'markdown', 'objective-c', 'objective-cpp', 'pascal', 'perl', 'perl6', 'php', 'powershell', 'jade', 'python', 'r', 'razor', 'ruby', 'rust', 'scss', 'sass', 'scala', 'shaderlab', 'shellscript', 'sql', 'swift', 'typescript', 'typescriptreact', 'tex', 'vb', 'xml', 'xsl', 'yaml']
""" Predefined Language kinds
@since 3.18.0
@proposed """


class LanguageKind(StrEnum):
Expand Down Expand Up @@ -547,12 +554,6 @@ class LanguageKind(StrEnum):
YAML = 'yaml'


LanguageKindLiteral = Literal['abap', 'bat', 'bibtex', 'clojure', 'coffeescript', 'c', 'cpp', 'csharp', 'css', 'd', 'pascal', 'diff', 'dart', 'dockerfile', 'elixir', 'erlang', 'fsharp', 'git-commit', 'rebase', 'go', 'groovy', 'handlebars', 'haskell', 'html', 'ini', 'java', 'javascript', 'javascriptreact', 'json', 'latex', 'less', 'lua', 'makefile', 'markdown', 'objective-c', 'objective-cpp', 'pascal', 'perl', 'perl6', 'php', 'powershell', 'jade', 'python', 'r', 'razor', 'ruby', 'rust', 'scss', 'sass', 'scala', 'shaderlab', 'shellscript', 'sql', 'swift', 'typescript', 'typescriptreact', 'tex', 'vb', 'xml', 'xsl', 'yaml']
""" Predefined Language kinds
@since 3.18.0
@proposed """


class InlineCompletionTriggerKind(IntEnum):
""" Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.
Expand All @@ -564,6 +565,12 @@ class InlineCompletionTriggerKind(IntEnum):
""" Completion was triggered automatically while editing. """


PositionEncodingKindLiteral = Literal['utf-8', 'utf-16', 'utf-32']
""" A set of predefined position encoding kinds.
@since 3.17.0 """


class PositionEncodingKind(StrEnum):
""" A set of predefined position encoding kinds.
Expand All @@ -583,12 +590,6 @@ class PositionEncodingKind(StrEnum):
encoding-agnostic representation of character offsets. """


PositionEncodingKindLiteral = Literal['utf-8', 'utf-16', 'utf-32']
""" A set of predefined position encoding kinds.
@since 3.17.0 """


class FileChangeType(IntEnum):
""" The file event type """
Created = 1
Expand Down Expand Up @@ -672,6 +673,13 @@ class CodeActionTriggerKind(IntEnum):
also be triggered when file content changes. """


FileOperationPatternKindLiteral = Literal['file', 'folder']
""" A pattern kind describing if a glob pattern matches a file a folder or
both.
@since 3.16.0 """


class FileOperationPatternKind(StrEnum):
""" A pattern kind describing if a glob pattern matches a file a folder or
both.
Expand All @@ -683,13 +691,6 @@ class FileOperationPatternKind(StrEnum):
""" The pattern matches a folder only. """


FileOperationPatternKindLiteral = Literal['file', 'folder']
""" A pattern kind describing if a glob pattern matches a file a folder or
both.
@since 3.16.0 """


class NotebookCellKind(IntEnum):
""" A notebook cell kind.
Expand All @@ -700,6 +701,9 @@ class NotebookCellKind(IntEnum):
""" A code-cell is source code. """


ResourceOperationKindLiteral = Literal['create', 'rename', 'delete']


class ResourceOperationKind(StrEnum):
Create = 'create'
""" Supports creating new files and folders. """
Expand All @@ -709,7 +713,8 @@ class ResourceOperationKind(StrEnum):
""" Supports deleting existing files and folders. """


ResourceOperationKindLiteral = Literal['create', 'rename', 'delete']
FailureHandlingKindLiteral = Literal['abort', 'transactional', 'textOnlyTransactional', 'undo']


class FailureHandlingKind(StrEnum):
Abort = 'abort'
Expand All @@ -727,19 +732,17 @@ class FailureHandlingKind(StrEnum):
guarantee that this is succeeding. """


FailureHandlingKindLiteral = Literal['abort', 'transactional', 'textOnlyTransactional', 'undo']

class PrepareSupportDefaultBehavior(IntEnum):
Identifier = 1
""" The client's default behavior is to select the identifier
according the to language's syntax rule. """


class TokenFormat(StrEnum):
Relative = 'relative'
TokenFormatLiteral = Literal['relative']


TokenFormatLiteral = Literal['relative']
class TokenFormat(StrEnum):
Relative = 'relative'


Definition = Union['Location', List['Location']]
Expand Down
Loading

0 comments on commit 1bf6284

Please sign in to comment.