Skip to content

Commit

Permalink
Exempt Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
jwortmann committed Apr 4, 2024
1 parent 0fc0e1e commit 4dd2e91
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions plugin/core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@


ST_VERSION = int(sublime.version())
ST_PLATFORM = sublime.platform()

# Keys for View.add_regions
HOVER_HIGHLIGHT_KEY = 'lsp_hover_highlight'
Expand Down
4 changes: 3 additions & 1 deletion plugin/session_buffer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .core.constants import DOCUMENT_LINK_FLAGS
from .core.constants import SEMANTIC_TOKEN_FLAGS
from .core.constants import ST_PLATFORM
from .core.protocol import ColorInformation
from .core.protocol import Diagnostic
from .core.protocol import DocumentDiagnosticParams
Expand Down Expand Up @@ -168,7 +169,8 @@ def _check_did_open(self, view: sublime.View) -> None:

def _check_did_close(self, view: sublime.View) -> None:
if self.opened and self.should_notify_did_close():
self.purge_changes_async(view, suppress_requests=True)
if ST_PLATFORM != 'linux': # https://github.com/sublimelsp/LSP/pull/2438
self.purge_changes_async(view, suppress_requests=True)
self.session.send_notification(did_close(uri=self._last_known_uri))
self.opened = False

Expand Down
5 changes: 5 additions & 0 deletions tests/test_single_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from setup import YieldPromise
import os
import sublime
import sys
import unittest


try:
Expand Down Expand Up @@ -406,6 +408,9 @@ class AnotherDocumentTestCase(TextDocumentTestCase):
def get_test_name(cls) -> str:
return "testfile2"

# The fix from https://github.com/sublimelsp/LSP/pull/2438 oddly causes an unrelated test to fail on Linux, so it's
# only applied on Windows and macOS for now.
@unittest.skipIf(sys.platform.startswith("linux"), "not working as expected on Linux")
def test_did_change_before_did_close(self) -> 'Generator':
assert self.view
self.view.window().run_command("chain", {
Expand Down

0 comments on commit 4dd2e91

Please sign in to comment.