From ec16d95429d9aeea1876b927dffcdb203f87fcd9 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: Fri, 19 Apr 2024 03:17:42 -0700 Subject: [PATCH 1/3] fix Discord link (#2449) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit reported on discord FichteFoll — Yesterday at 11:31 AM FYI, I just noticed that you have a discord link to a channel in the footer of the docs (i.e. https://lsp.sublimetext.io/). This does not work for people not already part of the server. Please use the invite link in the channel topic instead (also mentioned in --- docs/mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 53783ba14..2cc5f8d1d 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -66,4 +66,4 @@ nav: extra: social: - icon: fontawesome/brands/discord - link: https://discordapp.com/channels/280102180189634562/645268178397560865 + link: https://discord.gg/TZ5WN8t From 1ea635c9ccf7a5783ca0540de3f6a9679431cb43 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: Fri, 19 Apr 2024 09:14:37 -0700 Subject: [PATCH 2/3] Switch to python 3.8 (#2418) * "Add .python-version file" * remove pathlib from dependencies * change import * Revert "change import" (: This reverts commit c70cd57055ddeb8ca0b4ff36acb8531dd81a6e07. * Fix failing unittests on MacOS (#2436) This commit adopts `unittesting.ViewTestCase` to run view related test cases. ViewTestCase ... 1. provides `view` and `window` members pointing to a dedicated view, being created for testing. 2. ensures not to close empty windows, which was probably the most likely reason for unittests failing before on MacOS. * keep the same order as before * rchlint * add release notes * tweak release message * Be more descriptive of what the user expect, or what the user can do if things go wrong * tweak words * fix typos --------- Co-authored-by: Rafal Chlodnicki Co-authored-by: deathaxe Co-authored-by: Raoul Wols Co-authored-by: Predrag --- .github/workflows/main.yml | 2 -- .python-version | 1 + dependencies.json | 1 - messages.json | 1 + messages/2.0.0.txt | 32 ++++++++++++++++++++++ tests/test_configurations.py | 51 ++++++++++++++++-------------------- 6 files changed, 56 insertions(+), 32 deletions(-) create mode 100644 .python-version create mode 100644 messages/2.0.0.txt diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4226f7909..ce5bfa1d0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,8 +24,6 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - if: ${{ matrix.os == 'macOS-latest' }} - run: brew unlink openssl - uses: SublimeText/UnitTesting/actions/setup@v1 - uses: SublimeText/UnitTesting/actions/run-tests@v1 with: diff --git a/.python-version b/.python-version new file mode 100644 index 000000000..cc1923a40 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.8 diff --git a/dependencies.json b/dependencies.json index b7f778153..0a08cadb6 100644 --- a/dependencies.json +++ b/dependencies.json @@ -3,7 +3,6 @@ ">=4096": [ "bracex", "mdpopups", - "pathlib", "wcmatch" ] } diff --git a/messages.json b/messages.json index 68ebb9221..a8333cbea 100644 --- a/messages.json +++ b/messages.json @@ -37,5 +37,6 @@ "1.7.0": "messages/1.7.0.txt", "1.8.0": "messages/1.8.0.txt", "1.9.0": "messages/1.9.0.txt", + "2.0.0": "messages/2.0.0.txt", "install": "messages/install.txt" } diff --git a/messages/2.0.0.txt b/messages/2.0.0.txt new file mode 100644 index 000000000..a998ff019 --- /dev/null +++ b/messages/2.0.0.txt @@ -0,0 +1,32 @@ +=> 2.0.0 + +⚠️ Sublime Text will need to be restarted **more than once** for things to work properly. ⚠️ + +# Breaking changes + +- LSP and LSP-* packages are transitioning from Python 3.3 to Python 3.8. + +# FAQ + +### What are the most significant improvements that stem from the 3.3 to 3.8 change? + +There are no new features. +This is an internal LSP codebase change that affects all LSP-* packages. + +### LSP is broken after the update even if Sublime Text is restarted many times + +If that is the case, follow these steps: + +- ##### Check if `"index_files"` is set to `false` in `Preferences.sublime-settings` + +From the command palette open `Preferences: Settings` and see if `"index_files": false` exists. +If yes, remove that setting. + +- ##### Check if `"LSP"` is put in `"ignored_packages"` in `Preferences.sublime-settings` + +Ensure that LSP hasn't been added to the "ignored_packages" list during the update. If it has, remove it. + +- ##### Reach for help + +Feel free to [open an issue](https://github.com/sublimelsp/LSP/issues/new?assignees=&labels=&projects=&template=bug_report.md&title=) or reach out to us on [Discord](https://discord.gg/TZ5WN8t) if you encounter any problems during the update. +Please provide logs from the Sublime Text console. diff --git a/tests/test_configurations.py b/tests/test_configurations.py index 93af0a0ef..533c12229 100644 --- a/tests/test_configurations.py +++ b/tests/test_configurations.py @@ -1,12 +1,13 @@ from LSP.plugin.core.configurations import WindowConfigManager from test_mocks import DISABLED_CONFIG from test_mocks import TEST_CONFIG +from unittest import TestCase from unittest.mock import MagicMock +from unittesting import ViewTestCase import sublime -import unittest -class GlobalConfigManagerTests(unittest.TestCase): +class GlobalConfigManagerTests(TestCase): def test_empty_configs(self): window_mgr = WindowConfigManager(sublime.active_window(), {}) @@ -24,35 +25,29 @@ def test_override_config(self): self.assertFalse(list(window_mgr.all.values())[0].enabled) -class WindowConfigManagerTests(unittest.TestCase): +class WindowConfigManagerTests(ViewTestCase): def test_no_configs(self): - view = sublime.active_window().active_view() - self.assertIsNotNone(view) - assert view - manager = WindowConfigManager(sublime.active_window(), {}) - self.assertEqual(list(manager.match_view(view)), []) + self.assertIsNotNone(self.view) + self.assertIsNotNone(self.window) + manager = WindowConfigManager(self.window, {}) + self.assertEqual(list(manager.match_view(self.view)), []) def test_with_single_config(self): - window = sublime.active_window() - view = window.active_view() - self.assertIsNotNone(view) - assert view - manager = WindowConfigManager(window, {TEST_CONFIG.name: TEST_CONFIG}) - view.syntax = MagicMock(return_value=sublime.Syntax( + self.assertIsNotNone(self.view) + self.assertIsNotNone(self.window) + manager = WindowConfigManager(self.window, {TEST_CONFIG.name: TEST_CONFIG}) + self.view.syntax = MagicMock(return_value=sublime.Syntax( path="Packages/Text/Plain text.tmLanguage", name="Plain Text", scope="text.plain", hidden=False )) - view.settings().set("lsp_uri", "file:///foo/bar.txt") - self.assertEqual(list(manager.match_view(view)), [TEST_CONFIG]) + self.view.settings().set("lsp_uri", "file:///foo/bar.txt") + self.assertEqual(list(manager.match_view(self.view)), [TEST_CONFIG]) def test_applies_project_settings(self): - window = sublime.active_window() - view = window.active_view() - assert view - window.project_data = MagicMock(return_value={ + self.window.project_data = MagicMock(return_value={ "settings": { "LSP": { "test": { @@ -61,24 +56,22 @@ def test_applies_project_settings(self): } } }) - manager = WindowConfigManager(window, {DISABLED_CONFIG.name: DISABLED_CONFIG}) - view.syntax = MagicMock(return_value=sublime.Syntax( + manager = WindowConfigManager(self.window, {DISABLED_CONFIG.name: DISABLED_CONFIG}) + self.view.syntax = MagicMock(return_value=sublime.Syntax( path="Packages/Text/Plain text.tmLanguage", name="Plain Text", scope="text.plain", hidden=False )) - view.settings().set("lsp_uri", "file:///foo/bar.txt") - configs = list(manager.match_view(view)) + self.view.settings().set("lsp_uri", "file:///foo/bar.txt") + configs = list(manager.match_view(self.view)) self.assertEqual(len(configs), 1) config = configs[0] self.assertEqual(DISABLED_CONFIG.name, config.name) self.assertTrue(config.enabled) def test_disables_temporarily(self): - window = sublime.active_window() - view = window.active_view() - window.project_data = MagicMock(return_value={ + self.window.project_data = MagicMock(return_value={ "settings": { "LSP": { "test": { @@ -88,7 +81,7 @@ def test_disables_temporarily(self): } }) - manager = WindowConfigManager(window, {DISABLED_CONFIG.name: DISABLED_CONFIG}) + manager = WindowConfigManager(self.window, {DISABLED_CONFIG.name: DISABLED_CONFIG}) # disables config in-memory manager.disable_config(DISABLED_CONFIG.name, only_for_session=True) - self.assertFalse(any(manager.match_view(view))) + self.assertFalse(any(manager.match_view(self.view))) From 1c6d8bc7fdb6ac597fb57162987e7dc60b37a5e5 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: Fri, 19 Apr 2024 18:56:42 +0200 Subject: [PATCH 3/3] Cut 2.0.0 --- VERSION | 2 +- plugin/core/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index ff6d09b31..359a5b952 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.30.0 \ No newline at end of file +2.0.0 \ No newline at end of file diff --git a/plugin/core/version.py b/plugin/core/version.py index 3ecf3f5a1..14246847e 100644 --- a/plugin/core/version.py +++ b/plugin/core/version.py @@ -1 +1 @@ -__version__ = (1, 30, 0) +__version__ = (2, 0, 0)