GithubHelp home page GithubHelp logo

laughedelic / atom-ide-scala Goto Github PK

View Code? Open in Web Editor NEW
48.0 9.0 10.0 803 KB

:atom: Scala & Dotty support for Atom IDE (πŸ§Ÿβ€β™‚οΈ zombie repo)

Home Page: https://atom.io/packages/ide-scala

License: MIT License

Scala 100.00%
language-server atom-ide scalameta atom-ide-scala scalafmt scala atom-plugin ide lsp language-server-protocol

atom-ide-scala's Introduction

Hi there πŸ‘‹

atom-ide-scala's People

Contributors

cquiroz avatar ghisvail avatar jarlakxen avatar jvican avatar laughedelic avatar olafurpg avatar pofl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

atom-ide-scala's Issues

Use .ensime config to launch ENSIME server

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.

Failed to activate the ide-scala package

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.37.0 x64
Electron: 2.0.18
OS: Microsoft Windows 10 δΈ“δΈšη‰ˆ
Thrown From: ide-scala package 0.9.0

Stack Trace

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)

Commands

Non-Core Packages

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 

Completions don't (always) delete their prefix

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

  1. open a metals project
  2. create file src/main/scala/Foo.scala
  3. type
class Foo {
  java.time.Loc
}
  1. a popup has automatically appeared by now suggesting LocalDate, LocalTime, LocalDateTime, Clock.
  2. select LocalDateTime with arrows keys and accept
  3. text changes to
class 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.

Try to use sbt-node

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:

  • some of it could be reused or derived, like license, repository, author, etc.
  • other things defined explicitly through the plugin keys, like npmMain and npmDependencies

But probably this plugin will need some improvement to be able to generate arbitrary stuff (like consumedServices/providedServices)

Add a command to launch language server manually

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).

Uncaught Error: Connection is disposed.

[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

Stack Trace

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)

Commands

     -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)

Non-Core Packages

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 

Choice of language server and license

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.

Uncaught TypeError: d.getViewClass is not a function

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.43.0 x64
Electron: 4.2.7
OS: Mac OS X 10.15.2
Thrown From: ide-scala package 0.11.0

Stack Trace

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)

Commands

     -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)

Non-Core Packages

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 

Use glob patterns for filtering watched files

Each server defines a set of files it wants to watch. For example:

def watchFilter(filePath: String): Boolean = {
filePath.endsWith(".semanticdb") ||
filePath.endsWith(".properties") ||
filePath.endsWith("active.json")
}

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 dependency sources

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:

  • Register an opener for custom URIs, which will read the source and
  • Create read-only buffer with the content of the source.
    Read-only buffers exist since Atom 1.24, but are currently undocumented. Still, I see setReadonly method in sources, so I assumed it's supported.

Notify extra installation steps

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.

How to suppress diagnostics in build.sbt?

Great project, thanks!

Is there a way to suppress diagnostics in build.sbt? Maybe an ignore regex or checkbox to ignore sbt files? Couldn't find anything similar in atom-ide-ui.

image

Java 9: Java Home is not found or is invalid.

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

Does this package still work?

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?

Error starting Metals server

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

Improve warnings

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).

  • they should look different to be less confusing
  • they shouldn't appear on every new file open

Didn't worked until I manually installed "language-scala"

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.

Move the release notes to CHANGELOG.md

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.

Atom using a lot of CPU

Sometimes I see atom using a high amount of CPU which i think it's related to this plugin. How could I confirm for sure?

Here's an example
screenshot 2017-12-18 17 13 54

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.