profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/jwortmann/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

jwortmann/ini-syntax 11

Syntax highlighting for INI and REG files in Sublime Text

sublimelsp/LSP-julia 8

Plugin for the LSP client in Sublime Text with support for the Julia Language Server

jwortmann/brackets-color-scheme 7

Color scheme for Sublime Text inspired by Adobe Brackets

jwortmann/exapunks-syntax 6

Syntax highlighting for the EXAPUNKS assembly language in Sublime Text

jwortmann/quick-view 4

Image and color previews in Sublime Text

jwortmann/brackets-theme 1

Theme for Sublime Text inspired by Adobe Brackets

jwortmann/KleiAccountsLocale 0

Klei Accounts Website Translations.

jwortmann/LanguageServer.jl 0

An implementation of the Microsoft Language Server Protocol for the julia language.

jwortmann/LSP 0

Language Server Protocol support for Sublime Text 3

issue commentsublimelsp/LSP

Suggestion for callback: on_post_initialize

Doesn't this already exist as AbstractPlugin.__init__()? https://github.com/sublimelsp/LSP/blob/2100cd0fe003a44456e4f4c018ab775fdddddde1/plugin/core/sessions.py#L593-L600

I use it in LSP-julia to show a permanent message in the status bar, but only after the server is ready: https://github.com/sublimelsp/LSP-julia/blob/ad7415e040464afac39796fe07fd58c73b7f9120/plugin.py#L94-L100

I agree that a separate on_post_initialize would probably have been a better name than __init__ for this method. Note that on_pre_start is a classmethod, so I think you can't really communicate with a thread from that method unless you add global variables, which on the other hand would probably break in case someone starts multiple instances of the server at the same time. But it might work for debugging.

bostick

comment created time in 3 days

push eventjwortmann/LSP

Raoul Wols

commit sha 2100cd0fe003a44456e4f4c018ab775fdddddde1

Document LSP-rust-analyzer (#1855) closes #1850

view details

Janos Wortmann

commit sha 6beb9d549bec40cbce3730635a4db9e5128ae172

Don't update regions if there were changes to the buffer between request and response

view details

Janos Wortmann

commit sha bbd04cec27da99967002b0d1f71f18794f88f88d

Merge branch 'main' into semantic-highlighting

view details

push time in 4 days

PullRequestReviewEvent

Pull request review commentsublimelsp/LSP

Allow customizing diagnostics styles

 def r(name: str, default: Union[bool, int, str, list, dict]) -> None:             r("inhibit_snippet_completions", False)             r("inhibit_word_completions", True) -        # Backwards-compatible with "diagnostics_highlight_style"-        diagnostics_highlight_style = s.get("diagnostics_highlight_style")-        if isinstance(diagnostics_highlight_style, str):-            if not diagnostics_highlight_style:-                self.show_diagnostics_highlights = False+        # correctness checking will happen inside diagnostics_highlight_style_flags method+        self.diagnostics_highlight_style = s.get("diagnostics_highlight_style")++        # Backwards-compatible with "show_diagnostics_highlights"+        if self.diagnostics_highlight_style is None:+            show_diagnostics_highlights = s.get("show_diagnostics_highlights")+            self.diagnostics_highlight_style = "default" if show_diagnostics_highlights else ""

I think the only thing you need to do here is to set all styles to "" if "show_diagnostics_highlights" is False. Otherwise the default values are already defined by the default setting for "diagnostics_highlight_style".

iamkroot

comment created time in 5 days

Pull request review commentsublimelsp/LSP

Allow customizing diagnostics styles

 def document_highlight_style_region_flags(self) -> Tuple[int, int]:         else:             return sublime.DRAW_NO_FILL, sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.DRAW_SOLID_UNDERLINE +    @staticmethod+    def _style_str_to_flag(style_str: str) -> int:+        # This method could be a dict or lru_cache+        if style_str == "":+            return sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE+        elif style_str == "box":+            return sublime.DRAW_NO_FILL+        elif style_str == "underline":+            return sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.DRAW_SOLID_UNDERLINE+        elif style_str == "stippled":+            return sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.DRAW_STIPPLED_UNDERLINE+        elif style_str == "squiggly":+            return sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.DRAW_SQUIGGLY_UNDERLINE+        else:+            return 0  # default styling++    def diagnostics_highlight_style_flags(self) -> List[int]:+        """Returns flags for highlighting diagnostics on single lines per severity"""+        if isinstance(self.diagnostics_highlight_style, str):+            # same style for all severity levels+            return [self._style_str_to_flag(self.diagnostics_highlight_style)] * 4+        elif isinstance(self.diagnostics_highlight_style, dict):+            flags = []+            for sev in ("error", "warning", "info", "hint"):+                user_style = self.diagnostics_highlight_style.get(sev)+                if user_style is None:  # user did not provide a style+                    flags.append(0)

I guess it is used because it evaluates to "false", and that allows to use a convenient way to get the actual value with an or or if ... else in the other function below. But maybe it would be more readable to do this logic right here and just append the actual default value for each severity instead of 0.

iamkroot

comment created time in 5 days

PullRequestReviewEvent

issue commentsublimelsp/LSP

Could not start LSP-* due to not being able to find Node.js runtime on the PATH

What's the best way for now to not loose the server, stop package control from upgrading the plugin (lsp-pyright, ...) ?

Package Control has this setting (in Package Control.sublime-settings):

{
	// Packages to not auto upgrade
	"auto_upgrade_ignore": [],
}
predragnikolic

comment created time in 6 days

pull request commentsublimehq/Packages

[CSS] Add smart_typing setting

An analogue would be to have a similar keybinding for when you type the : after the key within Python dicts, which would then insert a space and a comma at the end of the line. This would also be pretty surprising, no?

deathaxe

comment created time in 7 days

pull request commentsublimehq/Packages

[CSS] Add smart_typing setting

This setting has been choosen for the same reason as you proposing auto_complete_trailing_spaces. It is an existing setting which is used for all those kinds of adding pairs of characters, so it seemed suitable. If the additionally added space is ignored it behaves very much like a normal pair.

The difference is that "auto_complete_trailing_spaces" would exactly describe what happens, while "auto_match_enabled" is "only" the best fitting one of the existing settings, for the : & ; combo. I didn't claim to remove this setting there, my personal preference would just be to remove the additional space.

Who says pairs must always be equal characters?

Nobody, but I think for all other pairs the characters directly belong together. In CSS properties, the colon has nothing to do with the semicolon. The colon's purpose is to be a key-value separator, and the semicolon closes this expression and separates it from the next property. The semicolon can even be omitted if it is the last property in a CSS rule.

deathaxe

comment created time in 7 days

issue commentsublimelsp/LSP

Ruby Solargraph stuck on "mapping workspace" loop

I don't think it has anything to do with workDoneProgress. The workDoneProgress/create request from the server with the token looks fine and LSP correctly responds in compliance with JSON-RPC and the LSP specs.

What looks somewhat suspicious to me from the log, is that LSP send textDocument/didOpen and then immediately textDocument/didClose for the same document and then the shutdown request. Did you manually close the tab in the editor? Otherwise something seems to went wrong there.

jamesWalker55

comment created time in 7 days

pull request commentsublimehq/Packages

[CSS] Add smart_typing setting

Is it still a "trailing" space if it is followed by a semicolon when auto completing a property?

I would say yes, because it is trailing for the left side of the cursor. The semicolon can simply be ignored, because the cursor just steps over it if you manually type the ; after the value. The "auto_complete_trailing_spaces" addresses the preference whether you want to manually add a space when you continue typing after using autocomplete, or rather have ST insert it for you. So I think it can be assumed that this setting also applies to completions from css_completions.py.

Regarding the keybinding for :, I indeed wouldn't really call it "auto complete". Actually, I'm on the side of the user from the other PR #2912 and would remove the space completely in this case. When you just type the colon character, I find it quite unexpected that it will automatically insert a space to the left side of the cursor, and I ended up with double spaces as well, until I overrode this keybinding in my user settings. But the average user might not know that it is caused by a keybinding for : and how to manually disable it, so I can understand the complains.

This keybinding is only active with "auto_match_enabled", but in general I find it a bit strange, because would you consider the : and ; really a pair, similar to quotes or brackets? If you close your eyes and type blindly, you should end up with exactly what you typed (except for <kbd>Enter</kbd> or <kbd>Tab</kbd> for confirming autocompletion, of course), and not with additional spaces, in my opinion. And this is how it always worked for all the other "auto match" bindings too.

For the newline in front of semicolons or the double-space between /* | */, you could use the "smart_typing" setting, or just leave it as it is now with "auto_match_enabled".

deathaxe

comment created time in 7 days

pull request commentsublimehq/Packages

[CSS] Add smart_typing setting

I like the approach to make it configurable via a setting, but wouldn't the already existing "auto_complete_trailing_spaces" setting fit very well for the "space after colon" case?

{
	// Add a space after completions if the auto complete engine thinks
	// they're likely enough
	"auto_complete_trailing_spaces": true,
}
deathaxe

comment created time in 8 days

pull request commentsublimelsp/LSP

Allow customizing diagnostics styles

I would drop the value "default" and explicitly use the mapping to severities as the default setting value. This makes it easier for users to see what the setting is expected to look like, if they want to adjust styles per severity.

In "markdownDescription" you can use Markdown as its name says ;) So fenced code blocks or indented code blocks should both work. I think sometimes the Markdown parser expects double linebreaks for correct formatting. For example:

"markdownDescription": "Highlight style of code diagnostics.\nThis is a fenced code block:\n\n```json\n{\n    "hello": "world"\n}\n```\n"

There is also a copy/paste error from "document highlights" in the settings description, and the name for Python's "dict" in JSON would be "object" (or you could use a generic word like "mapping" instead).

iamkroot

comment created time in 8 days

push eventjwortmann/LSP

Raoul Wols

commit sha 237437041d0a7344169f4add240bafd2d5bdb582

Cut 1.11.0

view details

Janos Wortmann

commit sha 4f4e7aeac2603129672991260ea3735003b052c8

Fix off-by-one error in scope name popup

view details

Janos Wortmann

commit sha 41ad058a6719b26e39ab41b8f88d96999e4a9ef2

Merge branch 'main' into semantic-highlighting

view details

push time in 8 days

delete branch jwortmann/LSP

delete branch : lsp-save-enabled

delete time in 10 days

push eventjwortmann/LSP

Janos Wortmann

commit sha cd8674bbef976097b2e611eec1a0fd4ec4ca5f92

Add a comment to explain the workaround

view details

push time in 11 days

PullRequestReviewEvent

Pull request review commentsublimelsp/LSP

Ensure lsp_save actually runs when context is active for keybinding

 def run(self, edit: sublime.Edit) -> None:         else:             self._trigger_native_save() +    def is_enabled(self, event: Optional[dict] = None, point: Optional[int] = None) -> bool:+        return True

By the way, this bug affects other things too. For example DocumentHighlights still seem to work fine, while most other things like hover won't work anymore with such a view.

jwortmann

comment created time in 11 days

Pull request review commentsublimelsp/LSP

Ensure lsp_save actually runs when context is active for keybinding

 def run(self, edit: sublime.Edit) -> None:         else:             self._trigger_native_save() +    def is_enabled(self, event: Optional[dict] = None, point: Optional[int] = None) -> bool:+        return True

DocumentSyncListener.on_query_context returns True if a view is dragged to a new window, while LspTextCommand.is_enabled returns False. I don't know why this divergence happens, but there must be something fundamentally wrong with how applicable views are managed in a session or so. Probably due to the mentioned ST core issue that on_post_move_async isn't triggered. Anyway, on_query_context will cause the keybinding to be active, while is_enabled prevents the run method of lsp_save to be executed. This turns <kbd>Ctrl</kbd>+<kbd>S</kbd> into "noop". By enforcing is_enabled to be True is it at least ensured that the command is run, and the file can be saved. The bug affected users even if they don't use any code actions on save at all.

It should be pretty fine to have is_enabled always be True, because it is only used for that keybinding and not in code via run_command("lsp_save"). In general, it should not make much sense to do the same check twice whether the keybinding is applicable or not, both in on_query_context and in is_enabled. Eventually a proper fix would ensure that both will return the same value for lsp_save, so that the code actions on save also work as expected (not sure if they already work or not - I just wanted to fix the linked issue here).

I don't really know if the actual bug is in DocumentSyncListener.on_query_context or in LspTextCommand.is_enabled or somewhere else.

jwortmann

comment created time in 11 days

PullRequestReviewEvent

push eventjwortmann/LSP

Janos Wortmann

commit sha 3d0c9b0ea5097ee645d5b5391fbeec9e0d0262e0

Fix method signature

view details

push time in 11 days

PR opened sublimelsp/LSP

Ensure lsp_save actually runs when context is active for keybinding

Fixes #1791.

Not sure if it is a proper fix, but the logic to determine whether the keybinding is active or not, is already present in documents.py/on_query_context(). Otherwise, the is_enabled evaluating to False from LspTextCommand resulted in preventing <kbd>Ctrl</kbd>+<kbd>S</kbd> from doing anything, because that binding was active, but not actually run.

I would assume that the code actions on save still won't work in the case described in #1791, but I haven't tested it.

+3 -0

0 comment

1 changed file

pr created time in 11 days

create barnchjwortmann/LSP

branch : lsp-save-enabled

created branch time in 11 days

issue commentsublimelsp/LSP

lsp_save_all or a way to enable lsp_code_actions_on_save for save_all

Thanks, I understand. I guess the on_post* methods would also result in an infinite loop unless additional logic to prevent that was added. And as you already wrote in that issue, on_pre_save_async seems indeed absolutely useless to me, since it is basically the same as on_post_save_async. They should fix on_pre_save_async to wait with the save until the function has finished (wouldn't really be backward compatible, so I doubt it will happen like that, but existing packages which use it could switch to on_post_save_async in theory).

fserb

comment created time in 11 days

issue commentsublimelsp/LSP

lsp_save_all or a way to enable lsp_code_actions_on_save for save_all

It's not possible with the current ST API.

There are the following methods of sublime_plugin.ViewEventListener (and the same methods for EventListener):

  • on_pre_save()
  • on_pre_save_async()
  • on_post_save()
  • on_post_save_async()

I haven't followed the "code actions on save" PRs, so I don't know why lsp_save is necessary. Maybe you could summarize it, to save me from the effort to search through the code?

Without knowing the background of lsp_save, I would also advocate the option 2. from above, if somehow possible, due to the annoying bug #1791 of the lsp_save command (why is this issue closed when the bug still exists??).

fserb

comment created time in 11 days

push eventjwortmann/LSP

Janos Wortmann

commit sha b4983dc8b6af416a8bc41b4d04def559ffa74c84

Fix upper bound for diagnostic tags when initializing regins

view details

push time in 13 days

Pull request review commentsublimelsp/LSP

Send hover request to all sessions that supports hoverProvider

 def code_actions_content(self) -> str:         return "".join(formatted)      def hover_content(self) -> str:-        content = (self._hover.get('contents') or '') if isinstance(self._hover, dict) else ''-        return minihtml(self.view, content, allowed_formats=FORMAT_MARKED_STRING | FORMAT_MARKUP_CONTENT)+        contents = []+        for hover_response in self._hover_responses:+            content = (hover_response.get('contents') or '') if isinstance(hover_response, dict) else ''+            contents.append(minihtml(self.view, content, allowed_formats=FORMAT_MARKED_STRING | FORMAT_MARKUP_CONTENT))+        return ''.join(contents)

I like the "with <hr>" version a bit more, but I would leave it to you to decide. Or maybe someone can add a third opinion here.

predragnikolic

comment created time in 13 days

PullRequestReviewEvent

push eventjwortmann/LSP

Janos Wortmann

commit sha 21ef85fc8caa7322fd7b0944aa239cb34a190b09

I hate this linter

view details

push time in 13 days

push eventjwortmann/LSP

Janos Wortmann

commit sha c7e34f7bb9c3a9ecab89ab2600c354beed5193ee

Type annotation

view details

push time in 13 days