question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Syntax highlighting doesn't go away when problem fixed

See original GitHub issue

Parts of the code where there is a problem to be fixed are underlined, and variables that are unused are shadowed. This goes away when the problem is fixed, but NOT if there is still other problems to be fixed in the file.

For example, let’s take the following file with 2 problems:

import os           # [Pyright] [H] "os" is not accessed
a = "foo"
b = 2
c = a + b           # [Pyright reportGeneralTypeIssues] [E] ...

The os variable is shadowed, and a+b is underlined.

If I fix the error [E] by modifying b = 2 into b = "bar", then the error [E] goes away but a + b is style underlined.

Highlighting becomes OK only if I also fix the [H] problem, or if I reload the file.

Any idea on what’s wrong here ?

I also noticed that if only fixing the [E] and writing (:w), then reloading (:e) will correctly remove the underlined a + b, but undoing (u) will redo the underlining of a + b (and not any other modificaition).

Edit: Screenshots:

There is 2 problems One problem fixed, but underlining remains All problems fixed, underlining goes away
pyright-highligth-bug-01 pyright-highligth-bug-02 pyright-highligth-bug-03

What’s the output of :CocCommand pyright.version

[coc.nvim] coc-pyright 1.1.181 with Pyright 1.1.184

What’s the output of :CocCommand workspace.showOutput Pyright

Workspace: /home/p20aime
Using python from /home/p20aime/miniconda3/bin/python

[Warn  - 9:08:12 AM] Ignored rootPath /home/p20aime of client "pyright"
[Info  - 9:08:12 AM] Pyright language server 1.1.184 starting
[Info  - 9:08:12 AM] Server root directory: /home/p20aime/.config/coc/extensions/node_modules/coc-pyright/node_modules/pyright/dist/
[Info  - 9:08:12 AM] No pyproject.toml file found.
[Info  - 9:08:12 AM] Setting pythonPath for service "<default>": "/home/p20aime/miniconda3/bin/python"
[Warn  - 9:08:12 AM] stubPath typings is not a valid directory.
[Info  - 9:08:12 AM] Assuming Python version 3.9
[Info  - 9:08:12 AM] Assuming Python platform Linux
[Warn  - 9:08:12 AM] Exception received when installing file system watcher: TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js
[Warn  - 9:08:12 AM] Exception received when installing file system watcher: TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js
[Warn  - 9:08:12 AM] Exception received when installing file system watcher: TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js
[Warn  - 9:08:12 AM] Exception received when installing file system watcher: TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js
[Info  - 9:08:12 AM] Searching for source files
[Info  - 9:08:12 AM] No source files found.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Paul-Aimecommented, Nov 10, 2021

So I removed all vim installations and installed vim 8.2 from ppa:jonathonf/vim and there is no issue anymore

0reactions
fannheywardcommented, Nov 10, 2021

I’ve tested with Vim 8.2, can’t reproduce.

Read more comments on GitHub >

github_iconTop Results From Across the Web

C# syntax highlight doesn't work for some of the keywords
Visual Studio Community for Mac, version 7.6.6 (build 17). nameof is never highlighted as keyword. var is not highlighted if put inside foreach...
Read more >
syntax highlighting broken in xcode 11? - Apple Developer
Yes, syntax highlighting is badly broken in Xcode 11. Randomly code is not or wrongly highlighted. It does not help you but it...
Read more >
IntelliJ inspection syntax highlighting not updating after being ...
If I simply highlight the inspected part ( field.value ) and then cut it away and immediately paste it back, IntelliJ recognizes it...
Read more >
[QT22] EASILY fix syntax highlighting issues in Sublime Text 4
Sublime Text 4 contains not only new features, but also performance enhancements as well. One of those relates to syntax highlighting, ...
Read more >
Syntax Highlighting for Code - AnkiWeb
If you use the css option you won't have syntax highlighting in the editor component. ... Fixes If you get the pygments error,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found