pulsar-edit / pulsar

A Community-led Hyper-Hackable Text Editor
https://pulsar-edit.dev
Other
3.22k stars 137 forks source link

Problem with autocomplete on javascript files - DOM #379

Closed kurotom closed 1 year ago

kurotom commented 1 year ago

Thanks in advance for your bug report!

What happened?

I am transitioning from Atom to Pulsar, in JavaScript files the autocompletion does not work, for example, I do not get suggestions when I enter window or any other line to handle the DOM. Please help.

It does work in the JavaScript language itself, but doesn't show support for the DOM.

I downloaded Pulsar from official page, installed it using dnf, OS installation is fresh.

Pulsar version

Pulsar : 1.101.0-beta

Which OS does this happen on?

🐧 Red Hat based (Fedora, Alma, RockyLinux, CentOS Stream, etc.)

OS details

Fedora 36

Which CPU architecture are you running this on?

64-bit(x86_64)

What steps are needed to reproduce this?

  1. Create or open a JavaScript (.js) file.
  2. Write some line, for example, window
  3. It does not show any suggestions for DOM.

Additional Information:

Pulsar : 1.101.0-beta Electron: 12.2.3 Chrome : 89.0.4389.128 Node : 14.16.0

Daeraxa commented 1 year ago

I can't see any difference in behaviour between Pulsar and Atom 1.60.0. Was this provided by a package you had installed?

confused-Techie commented 1 year ago

Yeah @Daeraxa correct me if I'm wrong, but language-javascript doesn't provide any completions for DOM elements like window or document.

And I can't locate any of our other non-core packages that do provide this

kurotom commented 1 year ago

No problem, below is the list of installed packages.

Built-in Atom Packages (92)
β”œβ”€β”€ atom-dark-syntax@0.29.1
β”œβ”€β”€ atom-dark-ui@0.53.3
β”œβ”€β”€ atom-light-syntax@0.29.1
β”œβ”€β”€ atom-light-ui@0.46.3
β”œβ”€β”€ base16-tomorrow-dark-theme@1.6.0
β”œβ”€β”€ base16-tomorrow-light-theme@1.6.0
β”œβ”€β”€ one-dark-ui@1.12.5
β”œβ”€β”€ one-light-ui@1.12.5
β”œβ”€β”€ one-dark-syntax@1.8.4
β”œβ”€β”€ one-light-syntax@1.8.4
β”œβ”€β”€ solarized-dark-syntax@1.3.0
β”œβ”€β”€ solarized-light-syntax@1.3.0
β”œβ”€β”€ about@1.9.1
β”œβ”€β”€ archive-view@0.66.0
β”œβ”€β”€ autocomplete-atom-api@0.10.7
β”œβ”€β”€ autocomplete-css@0.17.5
β”œβ”€β”€ autocomplete-html@0.8.9
β”œβ”€β”€ autocomplete-plus@2.42.4
β”œβ”€β”€ autocomplete-snippets@1.12.1
β”œβ”€β”€ autoflow@0.29.4
β”œβ”€β”€ autosave@0.24.6
β”œβ”€β”€ background-tips@0.28.1
β”œβ”€β”€ bookmarks@0.46.0
β”œβ”€β”€ bracket-matcher@0.92.0
β”œβ”€β”€ command-palette@0.43.5
β”œβ”€β”€ dalek@0.2.2
β”œβ”€β”€ deprecation-cop@0.56.9
β”œβ”€β”€ dev-live-reload@0.48.1
β”œβ”€β”€ encoding-selector@0.23.9
β”œβ”€β”€ exception-reporting@0.43.1
β”œβ”€β”€ find-and-replace@0.220.1
β”œβ”€β”€ fuzzy-finder@1.14.3
β”œβ”€β”€ github@0.36.13
β”œβ”€β”€ git-diff@1.3.9
β”œβ”€β”€ go-to-line@0.33.0
β”œβ”€β”€ grammar-selector@0.50.1
β”œβ”€β”€ image-view@0.64.0
β”œβ”€β”€ incompatible-packages@0.27.3
β”œβ”€β”€ keybinding-resolver@0.39.1
β”œβ”€β”€ line-ending-selector@0.7.7
β”œβ”€β”€ link@0.31.6
β”œβ”€β”€ markdown-preview@0.160.2
β”œβ”€β”€ notifications@0.72.1
β”œβ”€β”€ open-on-github@1.3.2
β”œβ”€β”€ package-generator@1.3.0
β”œβ”€β”€ settings-view@0.261.11
β”œβ”€β”€ snippets@1.6.1
β”œβ”€β”€ spell-check@0.77.1
β”œβ”€β”€ status-bar@1.8.17
β”œβ”€β”€ styleguide@0.49.12
β”œβ”€β”€ symbols-view@0.118.4
β”œβ”€β”€ tabs@0.110.2
β”œβ”€β”€ timecop@0.36.2
β”œβ”€β”€ tree-view@0.229.1
β”œβ”€β”€ update-package-dependencies@0.13.1
β”œβ”€β”€ welcome@0.36.9
β”œβ”€β”€ whitespace@0.37.8
β”œβ”€β”€ wrap-guide@0.41.0
β”œβ”€β”€ language-c@0.60.20
β”œβ”€β”€ language-clojure@0.22.8
β”œβ”€β”€ language-coffee-script@0.50.0
β”œβ”€β”€ language-csharp@1.1.0
β”œβ”€β”€ language-css@0.45.4
β”œβ”€β”€ language-gfm@0.90.8
β”œβ”€β”€ language-git@0.19.1
β”œβ”€β”€ language-go@0.47.3
β”œβ”€β”€ language-html@0.53.1
β”œβ”€β”€ language-hyperlink@0.17.1
β”œβ”€β”€ language-java@0.32.1
β”œβ”€β”€ language-javascript@0.134.2
β”œβ”€β”€ language-json@1.0.5
β”œβ”€β”€ language-less@0.34.3
β”œβ”€β”€ language-make@0.23.0
β”œβ”€β”€ language-mustache@0.14.5
β”œβ”€β”€ language-objective-c@0.16.0
β”œβ”€β”€ language-perl@0.38.1
β”œβ”€β”€ language-php@0.48.1
β”œβ”€β”€ language-property-list@0.9.1
β”œβ”€β”€ language-python@0.53.6
β”œβ”€β”€ language-ruby@0.73.0
β”œβ”€β”€ language-ruby-on-rails@0.25.3
β”œβ”€β”€ language-rust-bundled@0.1.1
β”œβ”€β”€ language-sass@0.62.2
β”œβ”€β”€ language-shellscript@0.28.2
β”œβ”€β”€ language-source@0.9.0
β”œβ”€β”€ language-sql@0.25.10
β”œβ”€β”€ language-text@0.7.4
β”œβ”€β”€ language-todo@0.29.4
β”œβ”€β”€ language-toml@0.20.0
β”œβ”€β”€ language-typescript@0.6.4
β”œβ”€β”€ language-xml@0.35.3
└── language-yaml@0.32.0

Community Packages (14) /home/USER/.pulsar/packages
β”œβ”€β”€ atom-live-server@2.3.0
β”œβ”€β”€ atom-ternjs@0.20.0
β”œβ”€β”€ autocomplete-java@1.2.7
β”œβ”€β”€ autocomplete-python@1.17.1
β”œβ”€β”€ autocomplete-sql@0.5.0
β”œβ”€β”€ busy-signal@2.0.1
β”œβ”€β”€ hyperclick@0.1.5
β”œβ”€β”€ intentions@2.1.1
β”œβ”€β”€ linter@3.4.0
β”œβ”€β”€ linter-javac@1.10.0
β”œβ”€β”€ linter-python@3.1.2
β”œβ”€β”€ linter-ui-default@3.4.1
β”œβ”€β”€ minimap@4.40.1
└── react@0.18.0
Spiker985 commented 1 year ago

It's non-core, but I believe generic-lsp comes with a default handler for javascript/typescript which should provide auto complete for such elements

No grammar by itself will ever really provide those as they're largely dynamic

On Sun, Feb 12, 2023, 18:20 confused_techie @.***> wrote:

Yeah @Daeraxa https://github.com/Daeraxa correct me if I'm wrong, but language-javascript doesn't provide any completions for DOM elements like window or document.

And I can't locate any of our other non-core packages that do provide this

β€” Reply to this email directly, view it on GitHub https://github.com/pulsar-edit/pulsar/issues/379#issuecomment-1427161169, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3XPS67E6SXXMLAEB6DZDDWXFV2XANCNFSM6AAAAAAUZJTWXU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

savetheclocktower commented 1 year ago

Never used it myself, but I'm assuming it was atom-ternjs that provided those autocompletions. Did you migrate your config file from Atom? If not, it might just need some settings changed.

kurotom commented 1 year ago

I didn't migrate anything, I did a clean install of Pulse ide

savetheclocktower commented 1 year ago
Screen Shot 2023-02-12 at 3 45 07 PM

Looks like it's unchecked by default. Go to the list of packages in settings, find atom-ternjs, click on Settings, then check that box.

kurotom commented 1 year ago

Yes, I already have this option activated and it still doesn't work.

savetheclocktower commented 1 year ago

Just tried it out on my Pulsar installation. All I had to do was check that box and it started offering suggestions for window, document, etc.

Are you getting other completion suggestions? Like, for snippets and keywords and whatnot?

kurotom commented 1 year ago

It shows me suggestion and autocomplete correctly JavaScript when creating classes, the constructor, manipulating strings, creating array, function, etc. But it doesn't show me elements related to handling the DOM.

kurotom commented 1 year ago

Some images, it is seen that it works with JavaScript: https://imgur.com/dqzhc6E https://imgur.com/zw3sXzD https://imgur.com/SDfp9Ll

savetheclocktower commented 1 year ago

Then I'm out of ideas. You can check the developer tools (View -> Developer -> Toggle Developer Tools) to see if there are any tern-related errors in the console. You can restart Pulsar to see if that helps. If not, I'd rename your ~/.pulsar directory temporarily and restart to get a fresh config, then install only atom-ternjs and see if you can get that working. If so, that'd at least be step in the right direction.

If nothing works, maybe the folks on Discord will have some ideas that I haven't thought of.

kurotom commented 1 year ago

I tried that and it didn't fix the problem. I searched a lot and couldn't solve this problem, thanks anyway.

mauricioszabo commented 1 year ago

Did you configure TernJS? I just made a clean install of TernJS on Pulsar, then ran the command TernJS: Open Configuration, checked "browser", and I have autocomplete of DOM elements...

Tern

kurotom commented 1 year ago

Thank you very much @mauricioszabo and everyone, solved, now it works fine in Pulsar.