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

auto complete css dont work prety fine #1003

Open
5 tasks done
HelloWorldFR opened this issue May 14, 2024 · 3 comments
Open
5 tasks done

auto complete css dont work prety fine #1003

HelloWorldFR opened this issue May 14, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@HelloWorldFR
Copy link

HelloWorldFR commented May 14, 2024

Thanks in advance for your bug report!

  • Have you reproduced issue in safe mode?
  • Have you used the debugging guide to try to resolve the issue?
  • Have you checked our FAQs to make sure your question isn't answered there?
  • Have you checked to make sure your issue does not already exist?
  • Have you checked you are on the latest release of Pulsar?

What happened?

the list of the autocomplete popup show only 1 item

Pulsar version

1.116

Which OS does this happen on?

🪟 Windows

OS details

windows 10

Which CPU architecture are you running this on?

x86_64/AMD64

What steps are needed to reproduce this?

With a new default install
When i try to add the property in the 1st of the list, its dont show the liste

  • in the p block its no working,
  • in the div block its no working
  • in the last block is working

sample code:
p {
padding-right: 0px;
background-color: red;
}
div {
display: block;
padding-right: 0px;
}
span {
display: block;
padding-right: 0px;
}

Additional Information:

css

@HelloWorldFR HelloWorldFR added the bug Something isn't working label May 14, 2024
@HelloWorldFR
Copy link
Author

No bug whith pulsar 1.105

@savetheclocktower
Copy link
Sponsor Contributor

Sadly, I think this is a side-effect of the new Tree-sitter CSS grammar. I described some of its difficulties in #601 — it makes bad guesses about how to do completions in situations where the tree is not syntactically valid because the user is still typing. I think that tree-sitter-css itself should improve to be better at this sort of thing, but in the meantime there's not much we can do except use a different system internally to make better guesses about what the user is typing.

You didn't notice this problem in 1.105 because we hadn't started using the new grammars. That means that you have a decent workaround: try one of the config changes in #883 (under “I want to go back to the old highlighting!"). I think you'll have to revert to the TextMate grammar, but maybe the other config block will work instead.

This is something that should be more actively on our radar, so I'll either create an issue to track this or change this issue to include more context about the problem.

@savetheclocktower
Copy link
Sponsor Contributor

This is what I mean:

Screenshot 2024-05-16 at 9 34 50 AM

I'm almost certainly about to type a property — something that starts with padding — but tree-sitter-css thinks it's a tag name. And though it technically could end up as a tag name, autocomplete-css should resolve that ambiguity by offering me properties and tag names that match.

Screenshot 2024-05-16 at 9 36 13 AM

Once the colon is present, tree-sitter-css now thinks that pad is likely part of a property. At this point, autocomplete-css will suggest property completions, but it's a bit annoying to have to type the colon first, so this isn't a reasonable workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants