Skip to content

Commit

Permalink
Use "plaintext" language ID for plain text files (#2164)
Browse files Browse the repository at this point in the history
  • Loading branch information
predragnikolic authored Jan 5, 2023
1 parent 07ef2a0 commit bdb0c59
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
30 changes: 15 additions & 15 deletions language-ids.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/test_server_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
]}}
]
},
Expand Down Expand Up @@ -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"}
]}}
]
},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit bdb0c59

Please sign in to comment.