Skip to content
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

Adds linting messages on line hover to anaconda. Resolves #862 #864

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Kyu
Copy link

@Kyu Kyu commented May 27, 2020

* Added on_hover listener to show a popup if a line contains a linting messages
* Added "anaconda_linter_hover_message" to Anaconda.sublime-settings. Defaults to false.

Hi, this is my pull request for #862 . I know the contributing guide says to wait for the issue to be discussed, but I'm kinda impatient and I wanted this enhancement to be out there for others who want the feature.

Since this is a GUI feature, I didn't add any tests. Tell me if this should be fixed.
This is the first Sublime plugin I'm working on, and I added some comments(questions) in the code, any assistance would be appreciated.

Fixes #862



	* Added on_hover listener to show a popup if a line contains a linting messages
	* Added "anaconda_linter_hover_message" to Anaconda.sublime-settings. Defaults to false.
Copy link
Owner

@DamnWidget DamnWidget left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you use the anaconda_lib.Tooltip feature for this? It gives you some built-in functionality like loading themes from the css directory in the root of the project.

listeners/linting.py Outdated Show resolved Hide resolved
listeners/linting.py Outdated Show resolved Hide resolved
@Kyu Kyu force-pushed the issue_862 branch 2 times, most recently from 67ae14d to e31b2fa Compare May 28, 2020 08:03
@Kyu
Copy link
Author

Kyu commented May 28, 2020

😃

image

The message "undefined name 'five'" is missing, it removes messages if there are more than 3. Not sure why. Otherwise it works fine :/

    * Created new files: templates/tooltops/error_warning.tpl and templates/tooltips/error_warning_helper.tpl
    * Created new Class TooltipHelper in anaconda_lib/tooltips.py
    * Created new function get_specific_lineo_msgs in anaconda_lib/linting/sublime.py
    * Modified css/popup.css to add linting message color codes.
    * Modified Tooltip.show_tooltip in anaconda_lib/tooltips.py to add optional **kwargs for popup
    * Cleaned up listeners/linting.py, added css viewing using tooltips.py
@scuml
Copy link
Contributor

scuml commented Jun 2, 2020

Resolves #862

(Adding comment here so it is recognized bygithub)

@DamnWidget
Copy link
Owner

Looks good to me, anyone has any reason for this to not get merged?

@scuml
Copy link
Contributor

scuml commented Jun 2, 2020

I'm for merging. Looks good.

@Kyu
Copy link
Author

Kyu commented Jun 2, 2020

There’s a truncation issue, as I said in the other comment, also there a significan typo in show_popup I didn’t change so I’ll fix that when I get home.

@DamnWidget
Copy link
Owner

DamnWidget commented Jun 3, 2020

There’s a truncation issue, as I said in the other comment, also there a significan typo in show_popup I didn’t change so I’ll fix that when I get home.

I could not find anything wrong in your code that would point to the reason, I would say ship-it it is better than nothing, we could probably document this limitation

@Kyu
Copy link
Author

Kyu commented May 27, 2022

I randomly came across this. I don't use sublime much anymore, was this feature added in a separate commit? I can update the code if needed.

@AlphonseVA
Copy link

Any plans to merge this PR soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show error information when hovering over line
4 participants