-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make panels consistent #1524
Make panels consistent #1524
Conversation
file_regex will not have a space in front line_regex will have a space in front to tell them appart
Looks like a good opportunity to refactor the "rename" and "references" panel to a common builder class. We're going to need such a class anyway, as we'll also be needing to present the "callees" and "callers" from the new set of call hierarchy requests of 3.16: #1429 |
Something like this? class Panel:
def __init__(self, window: sublime.Window, name: str, unlisted=False):
self.window = window
self.panel = self.window.create_output_panel(name, unlisted)
self.name = "output.{}".format(name)
def is_open(self):
return self.window.active_panel() == self.name
def open(self):
self.window.run_command("show_panel", {"panel": self.name})
def hide(self):
self.window.run_command("hide_panel", {"panel": self.name})
def update(self, content: str):
self.panel.run_command("lsp_update_panel", {"characters": content})
def destroy(self):
self.window.destroy_output_panel(self.name) Not sure what you have envisioned :) |
A builder class... to abstract away all of the boring indent logic and formatting logic. So something like this: class PanelBuilder:
def preamble(self, text: str) -> None:
"""Set the preamble text"""
...
def filename(self, filename: str) -> None:
"""Render a filename to the panel"""
...
def diagnostic(self, diagnostic: Diagnostic) -> None:
"""Render a diagnostic to the panel"""
...
def location(self, range: Dict[str, Any], identifier: Optional[str] = None) -> None:
"""Render a reference/rename location"""
...
def __str__(self) -> str:
"""Flush the content as a string"""
... does that make sense? |
@rwols I know I haven't implemented your suggestion yet. (for the PanelBuilder) My question is, should I revert the 2a962e0 ? |
remove ensure_*_panel and ensure_panel and create_panel functions with a class Panel that abstracts all the interaction with the panels
7901a7c
to
2a962e0
Compare
This reverts commit 2a962e0.
I reverted the changes 2a962e0 |
1
I don't see the need for it to be honest. 2
Sounds good. 3
I don't understand why this is needed? Why doesn't SublimeLinter use a tab? http://www.sublimelinter.com/en/stable/ 4Please don't use string concatenation in windows.py |
Account if a user encounters files with more the 10000 lines
- to be consistent with Sublime text find in project - and it just gives a visual separation of the results, although there is no need for \n between filenames, I think that they help readability
before the References.sublime-syntax would match 16 references for 'Response' ^^ number 17 changes across 6 files. ^^ number after this commit those number won't be matched 16 references for 'Response' 17 changes across 6 files.
4 - is done. |
increment the row to account the \n for the spacing between filenames so that the phantoms appear at the right place Co-authored-by @rwols
0bcd931
to
cd71f79
Compare
Co-authored-by @rchl
This is a draft that aims to make the diagnostics, references and rename panel look the same.
Diagnostics before:
![Screenshot 2020-12-12 at 16 21 48](https://user-images.githubusercontent.com/22029477/101987819-b0913780-3c96-11eb-8b1f-ecf5aec47fbc.png)
Diagnostics after:
![Screenshot 2020-12-12 at 16 23 11](https://user-images.githubusercontent.com/22029477/101987825-b7b84580-3c96-11eb-944f-0f940efcc22d.png)
References before:
![Screenshot 2020-12-12 at 16 21 58](https://user-images.githubusercontent.com/22029477/101987830-c1da4400-3c96-11eb-977b-6b036f4a975f.png)
References after:
![Screenshot 2020-12-12 at 16 23 18](https://user-images.githubusercontent.com/22029477/101987842-cacb1580-3c96-11eb-90e0-9e8615364d37.png)
Rename before:
![Screenshot 2020-12-12 at 16 22 05](https://user-images.githubusercontent.com/22029477/101987940-17165580-3c97-11eb-80a3-fc99a8b387c6.png)
Rename after:
![Screenshot 2020-12-12 at 16 23 25](https://user-images.githubusercontent.com/22029477/101987865-dae2f500-3c96-11eb-815e-7f0ac9cd2d91.png)
Questions
or
I think I can reuse the same syntax file for references to both references and rename panels? Should I delete the
Rename.sublime-syntax
file? Please give me a suggestion on what to do here. :)The line_regex now must contain a space in front.
I put a
\t
in front of any line diagnostics, is that ok change?