From bdb0c590ff173334752437d6d81e4c9981003ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D1=80=D0=B5=D0=B4=D1=80=D0=B0=D0=B3=20=D0=9D=D0=B8?= =?UTF-8?q?=D0=BA=D0=BE=D0=BB=D0=B8=D1=9B?= Date: Thu, 5 Jan 2023 22:23:24 +0100 Subject: [PATCH] Use "plaintext" language ID for plain text files (#2164) --- language-ids.sublime-settings | 30 +++++++++++++++--------------- tests/test_server_requests.py | 8 ++++---- tests/test_types.py | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/language-ids.sublime-settings b/language-ids.sublime-settings index 295277fd5..95587bbae 100644 --- a/language-ids.sublime-settings +++ b/language-ids.sublime-settings @@ -98,21 +98,21 @@ "text.html.markdown.rmarkdown": "r", // https://github.com/REditorSupport/sublime-ide-r "text.html.ngx": "html", // https://github.com/princemaple/ngx-html-syntax "text.jinja": "html", // https://github.com/Sublime-Instincts/BetterJinja - "text.plain": "txt", - "text.plain.buildpacks": "txt", // https://github.com/SublimeText/AFileIcon - "text.plain.eslint": "txt", // https://github.com/SublimeText/AFileIcon - "text.plain.fastq": "txt", // https://github.com/SublimeText/AFileIcon - "text.plain.license": "txt", // https://github.com/SublimeText/AFileIcon - "text.plain.lnk": "txt", // https://github.com/SublimeText/AFileIcon - "text.plain.log": "txt", // https://github.com/SublimeText/AFileIcon - "text.plain.nodejs": "txt", // https://github.com/SublimeText/AFileIcon - "text.plain.pcb": "txt", // https://github.com/SublimeText/AFileIcon - "text.plain.ps": "txt", // https://github.com/SublimeText/AFileIcon - "text.plain.python": "txt", // https://github.com/SublimeText/AFileIcon - "text.plain.readme": "txt", // https://github.com/SublimeText/AFileIcon - "text.plain.ruby": "txt", // https://github.com/SublimeText/AFileIcon - "text.plain.sketch": "txt", // https://github.com/SublimeText/AFileIcon - "text.plain.visualstudio": "txt", // https://github.com/SublimeText/AFileIcon + "text.plain": "plaintext", + "text.plain.buildpacks": "plaintext", // https://github.com/SublimeText/AFileIcon + "text.plain.eslint": "plaintext", // https://github.com/SublimeText/AFileIcon + "text.plain.fastq": "plaintext", // https://github.com/SublimeText/AFileIcon + "text.plain.license": "plaintext", // https://github.com/SublimeText/AFileIcon + "text.plain.lnk": "plaintext", // https://github.com/SublimeText/AFileIcon + "text.plain.log": "plaintext", // https://github.com/SublimeText/AFileIcon + "text.plain.nodejs": "plaintext", // https://github.com/SublimeText/AFileIcon + "text.plain.pcb": "plaintext", // https://github.com/SublimeText/AFileIcon + "text.plain.ps": "plaintext", // https://github.com/SublimeText/AFileIcon + "text.plain.python": "plaintext", // https://github.com/SublimeText/AFileIcon + "text.plain.readme": "plaintext", // https://github.com/SublimeText/AFileIcon + "text.plain.ruby": "plaintext", // https://github.com/SublimeText/AFileIcon + "text.plain.sketch": "plaintext", // https://github.com/SublimeText/AFileIcon + "text.plain.visualstudio": "plaintext", // https://github.com/SublimeText/AFileIcon "text.plist": "xml", // https://bitbucket.org/fschwehn/sublime_plist "text.xml.plist": "xml", // https://github.com/SublimeText/PackageDev "text.xml.plist.textmate.preferences": "xml", // https://github.com/SublimeText/PackageDev diff --git a/tests/test_server_requests.py b/tests/test_server_requests.py index 221bceea2..2ac9d5814 100644 --- a/tests/test_server_requests.py +++ b/tests/test_server_requests.py @@ -130,14 +130,14 @@ def test_m_client_registerCapability(self) -> Generator: {"method": "workspace/didChangeWorkspaceFolders", "id": "asdf"}, {"method": "textDocument/didOpen", "id": "1"}, {"method": "textDocument/willSaveWaitUntil", "id": "2", - "registerOptions": {"documentSelector": [{"language": "txt"}]}}, + "registerOptions": {"documentSelector": [{"language": "plaintext"}]}}, {"method": "textDocument/didChange", "id": "adsf", "registerOptions": {"syncKind": TextDocumentSyncKind.Full, "documentSelector": [ - {"language": "txt"} + {"language": "plaintext"} ]}}, {"method": "textDocument/completion", "id": "myCompletionRegistrationId", "registerOptions": {"triggerCharacters": ["!", "@", "#"], "documentSelector": [ - {"language": "txt"} + {"language": "plaintext"} ]}} ] }, @@ -206,7 +206,7 @@ def test_m_client_registerCapability(self) -> Generator: # Note that the triggerCharacters are disabled in the configuration. {"method": "textDocument/completion", "id": "anotherCompletionRegistrationId", "registerOptions": {"triggerCharacters": ["!", "@", "#"], "documentSelector": [ - {"language": "txt"} + {"language": "plaintext"} ]}} ] }, diff --git a/tests/test_types.py b/tests/test_types.py index 122c1bf91..a66b6a18f 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -59,7 +59,7 @@ def _make_view(self, syntax: str, file_name: str) -> sublime.View: return view def test_language(self) -> None: - selector = DocumentSelector([{"language": "txt"}]) + selector = DocumentSelector([{"language": "plaintext"}]) view = self._make_view("Packages/Text/Plain text.tmLanguage", "foobar.txt") self.assertTrue(selector.matches(view)) view = self._make_view("Packages/Python/Python.sublime-syntax", "hello.py")