laughedelic / atom-ide-scala Goto Github PK
View Code? Open in Web Editor NEW:atom: Scala & Dotty support for Atom IDE (π§ββοΈ zombie repo)
Home Page: https://atom.io/packages/ide-scala
License: MIT License
:atom: Scala & Dotty support for Atom IDE (π§ββοΈ zombie repo)
Home Page: https://atom.io/packages/ide-scala
License: MIT License
Current state: #3 (comment).
See discussion on Gitter:
we used to use coursier in the clients, it was messy and lead to a lot of issues. Since we are already parsing the .ensime in the clients for the source directories, it was better to read the classpath from there.
@laughedelic why can't you just use the code that
@vovapolu
has written, and which the ensime community has paid for, to parse the .ensime file and launch the server the way everybody expects and agrees with the sbt-ensime setup.
So once the reusable part of the https://github.com/ensime/ensime-lsp-clients projects matures enough and is published, I'm going to use it to launch ENSIME server "the way everybody expects" π
The relevant piece of code: javaArgs
.
[Enter steps to reproduce:]
Atom: 1.37.0 x64
Electron: 2.0.18
OS: Microsoft Windows 10 δΈδΈη
Thrown From: ide-scala package 0.9.0
Failed to activate the ide-scala package
At Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
Error: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
at StatusBarView.t.exports.StatusBarView.addRightTile (<embedded>:11:962543)
at a.consumeStatusBar (/packages/ide-scala/lib/main.js:221:399)
at Object.m.consumeStatusBar (/packages/ide-scala/lib/main.js:454:225)
at Provider.t.exports.Provider.provide (<embedded>:14:1040915)
at ServiceHub.t.exports.ServiceHub.consume (<embedded>:11:3534107)
at Package.activateServices (<embedded>:11:3542239)
at Package.activateNow (<embedded>:11:3539073)
at string.e.trim.length.activationHookSubscriptions.add.packageManager.onDidTriggerActivationHook (<embedded>:14:2445)
at Function.simpleDispatch (<embedded>:11:1174290)
at Emitter.emit (<embedded>:11:1175731)
at deferredActivationHooks.triggeredActivationHooks.forEach.e (<embedded>:11:382852)
at Set.forEach (<anonymous>)
at PackageManager.activatePackage (<embedded>:11:382814)
at <embedded>:11:901281
at r (<embedded>:11:895887)
at n (<embedded>:14:1043822)
at ChildProcess.o.process.on.e (<embedded>:14:1044028)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
autocomplete-bash-builtins 0.3.5
autocomplete-python 1.14.0
busy-signal 2.0.1
file-icons 2.1.33
fonts 3.4.0
Hydrogen 2.9.0
hyperclick 0.1.5
ide-scala 0.9.0
indent-detective 0.3.2
ink 0.10.10
intentions 1.1.5
julia-client undefined
kite 0.164.0
language-julia 0.19.0
language-scala 1.1.10
latex-completions 0.3.6
linter 2.3.0
linter-python-pep8 0.2.0
linter-ui-default 1.7.1
markdown-preview-enhanced 0.16.0
open-file 1.4.0
platformio-ide-terminal 2.9.1
project-manager 3.3.7
python-autopep8 0.1.3
python-isort 0.0.7
quick-query 1.1.0
remote-ftp 2.2.2
script 3.18.1
todo-show 2.3.2
tool-bar 1.1.11
tortoise-svn 0.5.1
uber-juno 0.2.0
ide-scala version: 0.9.0
metals version: 0.5.2
scala versions: 2.11.12, 2.12.8
operating systems: OSX, Windows
Steps to reproduce
src/main/scala/Foo.scala
class Foo {
java.time.Loc
}
LocalDate
, LocalTime
, LocalDateTime
, Clock
.LocalDateTime
with arrows keys and acceptclass Foo {
java.time.LocLocalDateTime
}
If you now undo
and retry the completion the Loc
prefix gets deleted. If you select the completion with the cursor the Loc
prefix gets deleted. If in the above scenario you select Clock
the Loc
prefix gets deleted.
https://github.com/jokade/sbt-node
It's a plugin for sbt that generates package.json
does some other npm related stuff. I'm not sure about the status of this project, but it seems useful. Would be nice to have all necessary information defined in sbt and generate package.json
from it:
npmMain
and npmDependencies
But probably this plugin will need some improvement to be able to generate arbitrary stuff (like consumedServices
/providedServices
)
Sometimes it's useful not to turn off automatic server launching (automatic server selection off and default server none
), but then there is not way to launch a server in the current project.
It could be either 3 separate commands, one for each server, or one command and a dialog to choose one. It could also suggest the server depending on the project setup (as if automatic server selection was on).
[Enter steps to reproduce:]
Just switching between .scala
files.
Atom: 1.33.0 x64
Electron: 2.0.11
OS: Mac OS X 10.14.1
Thrown From: ide-scala package 0.8.1
Uncaught Error: Connection is disposed.
At /Users/alexey.alekhin/.atom/packages/ide-scala/node_modules/vscode-jsonrpc/lib/main.js:664
Error: Connection is disposed.
at throwIfClosedOrDisposed (/packages/ide-scala/node_modules/vscode-jsonrpc/lib/main.js:664:19)
at Object.sendNotification (/packages/ide-scala/node_modules/vscode-jsonrpc/lib/main.js:711:13)
at LanguageClientConnection._sendNotification (/packages/ide-scala/node_modules/atom-languageclient/build/lib/languageclient.js:364:19)
at LanguageClientConnection.sendCustomNotification (/packages/ide-scala/node_modules/atom-languageclient/build/lib/languageclient.js:91:14)
at /packages/ide-scala/lib/main.js:5958:15)
at /packages/ide-scala/lib/main.js:5881:50
at Function.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1190583)
at Emitter.emit (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1192024)
at Workspace.didChangeActivePaneItemOnPaneContainer (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:424391)
at WorkspaceCenter.paneContainer.onDidChangeActivePaneItem.t (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:14:38690)
at Function.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1190583)
at Emitter.emit (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1192024)
at PaneContainer.didChangeActiveItemOnPane (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:446453)
at Pane.setActiveItem (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:455309)
at Pane.activateItem (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:457479)
at TabBarView.t.exports.TabBarView.onClick (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1141088)
-6:41.9.0 core:save (input.hidden-input)
2x -6:22.9.0 window:toggle-dev-tools (a.stack-toggle)
-2:52.6.0 datatip:toggle (input.hidden-input)
3x -2:45.4.0 find-and-replace:select-next (input.hidden-input)
-2:44 find-and-replace:select-all (input.hidden-input)
-2:43.1.0 vim-mode-plus:activate-normal-mode (input.hidden-input)
-2:42.6.0 editor:toggle-line-comments (input.hidden-input)
-2:42.2.0 vim-mode-plus:reset-normal-mode (input.hidden-input)
-2:41.8.0 core:save (input.hidden-input)
11x -2:34.4.0 find-and-replace:select-next (input.hidden-input)
-2:31.4.0 vim-mode-plus:activate-normal-mode (input.hidden-input)
-2:30.4.0 editor:toggle-line-comments (input.hidden-input)
-2:30 vim-mode-plus:reset-normal-mode (input.hidden-input)
-2:29.6.0 core:save (input.hidden-input)
-1:54.1.0 settings-view:open (input.hidden-input)
-1:00.5.0 core:copy (div.package-readme.native-key-bindings)
advanced-open-file 0.16.8
atom-ide-ui 0.13.0
autocomplete-paths 2.12.2
base16-syntax 1.8.1
bracket-colorizer 1.2.0
cursor-history 0.13.1
file-icons 2.1.26
highlight-selected 0.14.0
hyperlink-hyperclick 2.0.0
ide-json 0.2.1
ide-scala 0.8.1
key-peek 0.2.12
language-gitignore 0.3.0
language-jenkinsfile 0.1.1
language-scala 1.1.9
language-sql-bigquery 0.2.8
markdown-preview-enhanced 0.15.8
project-folder 1.5.0
simple-align 0.2.0
vim-mode-plus 1.36.0
vim-mode-plus-keymaps-for-surround 0.2.1
Thanks @laughedelic for working on a Atom-IDE package for Scala.
I was wondering what motivated your choice for the underlying language server over other choices. In VSCode, we have language packages for Scala backed by sbt
, ensime
and dotty
respectively. None uses scalameta
, hence my surprise.
On a separate topic, I am not sure of the benefits of the LGPL-3
license for Atom packages. Especially when the underlying backend (scalameta
) is permissively licensed.
[Enter steps to reproduce:]
Atom: 1.43.0 x64
Electron: 4.2.7
OS: Mac OS X 10.15.2
Thrown From: ide-scala package 0.11.0
Uncaught TypeError: d.getViewClass is not a function
At /Users/jeffreylemoine/.atom/packages/ide-scala/lib/main.js:95
TypeError: d.getViewClass is not a function
at Object.createView (/packages/ide-scala/lib/main.js:95:167)
at ViewRegistry.createView (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:324536)
at ViewRegistry.getView (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:324001)
at HTMLElement.activeItemChanged (/app.asar/src/pane-element.js:138:33)
at Function.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1212922)
at Emitter.emit (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1214363)
at Pane.setActiveItem (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:455685)
at Pane.activateItem (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:457933)
at TabBarView.onClick (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1164009)
-3:31.9.0 core:paste (input.hidden-input)
-3:28.9.0 core:select-left (input.hidden-input)
-3:28.6.0 core:select-up (input.hidden-input)
-3:28.3.0 core:select-right (input.hidden-input)
-3:25 core:paste (input.hidden-input)
-3:20.9.0 core:save (input.hidden-input)
-2:59.9.0 editor:newline (input.hidden-input)
12x -2:56.2.0 core:backspace (input.hidden-input)
-2:49.5.0 editor:newline (input.hidden-input)
-2:48.6.0 core:save (input.hidden-input)
-2:44.6.0 settings-view:open (input.hidden-input)
3x -2:00.8.0 core:backspace (input.hidden-input)
-1:58.5.0 editor:newline (input.hidden-input)
-1:45.1.0 core:select-all (input.hidden-input)
-1:00.6.0 core:backspace (input.hidden-input)
13x -0:52.1.0 core:move-left (input.hidden-input)
atom-bash 1.1.1
atom-ide-ui 0.13.0
autocomplete-python 1.16.0
ide-json 0.2.1
ide-python 1.5.0
ide-scala 0.11.0
language-scala 1.1.10
pretty-json 2.1.2
script 3.25.0
Each server defines a set of files it wants to watch. For example:
atom-ide-scala/src/main/scala/servers/Metals.scala
Lines 17 to 21 in 2460dd7
While Metals docs define them using glob filters.
I saw recently that atom-ide-ui has the node-glob library in dependencies, so we can add it here too and use for filtering watched files.
Use readonly text buffers when jumping to definitions from dependencies. See scalameta/metals#36.
This requires a change in Metals first so that it will send custom metals:
URIs for locations in definitions (instead of the current workaround with temporary files). Then on this side there are 2 things to be done:
setReadonly
method in sources, so I assumed it's supported.I think it could be very usefull, from a user experience perspective, if the plugin detect if ScalametaLanguageServerPlugin
is not present or if the user didn't run semanticdbEnable
. I could be just a notification with a link to Metals global setup.
Lots of the Atom plugin, if they require extra instalation steps, at least you recieve a notification about that.
This is provided by the AutoLanguageClient
interface:
So here we just need to expose this command in the Command Palette.
Since v0.11 Atom IDE UI has a terminal and it seems to be possible to open it with a given command: facebookarchive/atom-ide-ui#220 (comment).
It would be nice to have a command to open sbt shell inside Atom. It could be also useful to suggest it (as a notification with a button) when launching Metals, if there is no running sbt server yet (project/target/active.json
).
I get this: "Java Home is not found or is invalid. Try to set it explicitly in the plugin settings. Scala (Scalameta)" even after setting the Java Home in the plugin settings.
My guess: Java 9 no longer has a jar called tools.jar and the class ScalaLanguageClient
is trying to find it:
Fs.existsSync(Path.join(javaHome, "lib", "tools.jar"))
This seems to be related to a similar bug in ensime
I've tried multiple times to get this working, I'm being sent all over the place to install separate plugins globally and enable settings, I've tried with both Metals and Dotty to no avail. Does anyone know if the current version of this package still works, and if so, what the required steps are to get it working?
atom-ide-scala/src/main/scala/ServerType.scala
Lines 68 to 73 in 4c27d1e
TODO:
comment in 4c27d1e. It's been assigned to @laughedelic because they committed the code.Hi,
I get the following error when I try to start the Metals server.
stderr org.scalameta:metals_2.12:
stderr not found: /Users/hartmann/.ivy2/local/org.scalameta/metals_2.12/ivys/ivy.xml
stderr not found: https://repo1.maven.org/maven2/org/scalameta/metals_2.12//metals_2.12-.pom
stderr not found: https://dl.bintray.com/scalameta/maven/org/scalameta/metals_2.12//metals_2.12-.pom
Any idea how best to debug this?
Cheers
atom-ide-scala/src/main/scala/ScalaLanguageClient.scala
Lines 32 to 37 in 5bd3be4
TODO:
comment in 5bd3be4. It's been assigned to @laughedelic because they committed the code.There is an issue in the sbt plugin: laughedelic/sbt-atom-package#1, but I think it's better just to try here first.
Docs: https://www.npmjs.com/package/@atom/source-map-support
It would improve development experience a lot, because when things crash badly it's quite hard to trace back to the source of the problem in the original Scala.js code.
After #53 there are different types of warnings when you open a new project which is not setup for any language server: see #53 (comment).
I was very confused about what to do to activate the plugin once it was installed.
It turned out I had to manually install language-scala even though in the documentation it says that it will installed automatically.
On the first launch it will automatically install its dependencies if needed:
Anyway, hope this helps anyone else wondering why it doesn't work.
To ease the installation process. Instead of having to manually install those according to the instructions in the README, we might as well automate their installation. This is what is done for atom-ide-rust for instance.
atom-ide-scala/src/main/scala/ServerType.scala
Lines 51 to 56 in 4c27d1e
TODO:
comment in 4c27d1e. It's been assigned to @laughedelic because they committed the code.Please consider moving the release notes listed under notes/
to a single CHANGELOG.md
file in the root of the repository. This way, the release notes will be accessible from within the Atom (under CHANGELOG) and can be read without having to browse the source code on GitHub. Thanks.
It seems with metals 4.0 scalafmt could be enabled in Atom again. That would be very useful
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.