Comments (28)
As of 475958c there are per-project linters. I think it's working nicely but if you have a chance to try the latest master version that would be great.
from atom-sbt.
My usual practice for testing this kind of thing is to clone the package into the dev package directory and run Atom in dev mode (or Open Dev from the command palette). See this post for some instructions: https://discuss.atom.io/t/load-developing-package/2554/2.
from atom-sbt.
Yes, I agree that a status indicator will be useful. I had hacked one together myself but something supported by the linter will be better. I'll look into linter v2 properly as soon as I can.
from atom-sbt.
Supported in version 0.9.0 which is now published.
from atom-sbt.
Hmm, seems possible but how would you want it to work? E.g., would it be enough to associate sbt sessions with open projects and send commands to the session associated with the project of the file that has the focus? Or did you have something else in mind?
from atom-sbt.
I had in mind exactly what you described. It would be enough for at least how I use atom and sbt 👍
from atom-sbt.
One addition here: as you can add names to the terminal sessions, it would be better to put there project names, instead of just sbt
.
from atom-sbt.
0.7.0 will include a change to add the project path (either full or just base name configured by a setting) to the terminal title.
Having multiple sessions will take a bit longer...
from atom-sbt.
OK!
from atom-sbt.
About project name: if I have several sbt projects in the window and toggle sbt plugin for some of them, the name assigned to the terminal is the name of the first project in the window. For example, I have sbt-projects opened:
foo
bar
buh
then I go to some file in buh
and press alt-shift-O
to toggle sbt. Sbt is running for the buh
project as expected, but the terminal name is sbt foo
.
from atom-sbt.
Yeah, at the moment the package doesn't handle multiple projects well. It just picks the first path. I'm working on a design to make this better but there a bunch of factors to take into account so I'll need a little time to think about it. In the meantime a workaround is to run the sets in different Atom windows.
from atom-sbt.
Finally found some time to work on this package. 6757e0a fixes the bug where the wrong project name would be used if it wasn't the first project in the window.
Full support for multiple projects is still in progress.
from atom-sbt.
A first cut at support for multiple projects in a single window has been committed in ade0873.
@laughedelic if you are able to try this it would be appreciated. It works for me, but a sanity check from a real user would be good before I do a release.
from atom-sbt.
Hi! Sorry, I totally missed last comments here 😓
I just tried the version from master
and I see that now a new console window appears when I call it from another project and it's correctly named 👍 But if I try to send a command to it (through the command panel), it just opens the window without any command inserted there.
from atom-sbt.
No worries. Thanks for checking it out. Unfortunately, I can't reproduce the problem you are seeing. I open two projects in one Atom window, create sbt terminal windows for each and I can send commands successfully to the two windows (both via key mappings and via the command palette).
I'm clearly not doing exactly what you are doing. Can you give me a step-by-step way to reproduce it?
from atom-sbt.
What is the right way to install unreleased versions of plugins? I just clone the repo to ~/.atom/packages/sbt/
and run apm install
there. I tried both ade0873 and the latest in master
.
When I run any command with sbt (compile, toggle panel, whatever) it opens a new terminal panel for the right project with the right name and loads the project. But any attempts to send a command don't have any effect.
I still can enter the command manually, like ~compile
, but once I change a source to check that it actually works, it breaks the plugin:
Atom: 1.15.0-beta4 x64
Electron: 1.3.13
OS: Mac OS X 10.11.6
Thrown From: sbt package 0.8.0
Stack Trace
Uncaught ReferenceError: project is not defined
At /Users/laughedelic/.atom/packages/sbt/lib/project.coffee:145
ReferenceError: project is not defined
at Project.module.exports.Project.processData (/packages/sbt/lib/project.coffee:145:22)
at /packages/sbt/lib/project.coffee:68:10
at /app.asar/src/task.js:126:25
at Function.module.exports.Emitter.simpleDispatch (/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
at /app.asar/src/task.js:78:34)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at process.nextTick (internal/child_process.js:744:12)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
Commands
3x -3:23.1.0 sbt:compile (input.hidden-input)
2x -3:21.5.0 pane:show-previous-item (input.hidden-input)
-3:13.3.0 command-palette:toggle (input.hidden-input)
-3:11.1.0 core:confirm (input.hidden-input)
-3:11.1.0 sbt:exit (input.hidden-input)
-3:07.0 sbt:toggle-panel (textarea.)
-3:04.8.0 sbt:compile (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
-3:03.6.0 linter:expand-multiline-messages (input.hidden-input)
4x -3:02.9.0 sbt:compile (input.hidden-input)
-2:14.3.0 sbt:toggle-panel (textarea.)
-2:12.1.0 sbt:compile (input.hidden-input)
-2:10.5.0 linter:expand-multiline-messages (input.hidden-input)
2x -0:58.6.0 sbt:toggle-panel (input.hidden-input)
-0:21.7.0 vim-mode-plus:delete-right (input.hidden-input)
-0:21.3.0 core:save (input.hidden-input)
2x -0:09.8.0 sbt:toggle-panel (input.hidden-input)
from atom-sbt.
Thanks. I tried it and I get the same bahavior and the same error. It refers to lib/project.coffee:145
, which looks a bit strange to me:
processData: (data) ->
if @pendingClear
@clearMessages(project) // <-- here
@pendingClear = false
// ...
Method cleasMessages
doesn't seem to take parameters. And this reference to project
is unclear.. Anyway, I'm just guessing, I think you know what's actually going on.
from atom-sbt.
Yes, you're right. I don't use continuous commands (~) very much so I always forget to test that functionality. I've pushed bbf17f5 which fixes that problem.
from atom-sbt.
Well, it doesn't break now, but the behaviour is not very consistent.
- If I have 4 errors in one project and none in another, the linter shows 4 errors and jumps to them even from the files of the seconds project.
- Now if I add an error in the second project, it shows just 1 error and forgets about the others. And if I fix it, it shows no errors and doesn't remember about the first project.
I think that errors among sbt-project in the same window should get accumulated. Also I was wondering whether it would be possible to move the clearMessages
action to the end of the compilation, so that it doesn't switch to "No issues" while compiling (with possible errors after that).
from atom-sbt.
Ah, this is very useful feedback, because I confess that I wasn't sure the best way to make this work, so the current design is not set in stone.
Currently, as you noted, I will only show errors from one project at a time (the most recently built one). My reasoning is that if you are working on two projects together, it is likely that rebuilding one of them might change the error status of the other one and you will have to rebuild it anyway. So, it seemed wrong to leave "in play" the errors from the project that you are not building. Thus, at the moment any build causes the sbt errors to be cleared. Does this logic make sense to you?
I guess I"m not imagining a scenario where you would run a bunch of builds in different projects and then go through fixing the errors. I was thinking it would make more sense to do a one-by-one approach.
It's not clear that I can easily (or should) stop the "jump to errors in another project" behaviour since that's the way the linter works already. There's just one global collection of current messages. I would probably need to override the linter commands to make them project-specific but that would be counter-intuitive to existing linter users, I think.
from atom-sbt.
Thinking further on this, I think I should be able to have a separate linter client for each sbt project that has a running session. Then it would be possible to just clear the messages for the current project. But I think it's probably worth making this optional, because I think I would find that behaviour confusing.
from atom-sbt.
it seemed wrong to leave "in play" the errors from the project that you are not building
I see your point.
I guess I"m not imagining a scenario where you would run a bunch of builds in different projects and then go through fixing the errors. I was thinking it would make more sense to do a one-by-one approach.
Right, I think the problem is not jumping between different project errors, but rather updating the linter state when you switch between project files. I don't know if it's possible. Probably having a linter per project will help. I'm not familiar with linter API..
from atom-sbt.
About better status indication: linter v2 has something called Busy Signal Integration. This would be super nice to turn on while sbt is compiling so that it's obvious when the summary indicator (with number of errors/warnings) is yet to be updated.
from atom-sbt.
Also, linter V2 is now supported as of a22c61b. Please report problems on #16.
from atom-sbt.
Great! I will try out the latest master version.
from atom-sbt.
What I see now in the linter status is the total number of errors from all projects in the window. Is it how it's supposed to be? I though that per-project linters will maintain their own state and switch status panel when switching between files.
from atom-sbt.
Hmm, not sure. As far as I can see there is nothing that I can do except use a separate linter for each sbt project which I am now doing.
It seems that the "Statusbar presents" setting in the Linter UI only has "Current File" and "Entire Project" where the latter is interpreted to mean anything that's open in the window. Arguably there should be an "Entire Window" setting and "Entire Project" should be just for the project of the current file. Perhaps this is an issue for them?
from atom-sbt.
OK, I see. I'm fine with window-total. Just wanted to make sure it works as supposed.
from atom-sbt.
Related Issues (20)
- Continuous build and test HOT 5
- Turn off auto-toggle HOT 2
- Runtime exception from Atom HOT 4
- Terminal-plus is broken HOT 3
- Uncaught TypeError: Cannot read property 'indexOf' of null HOT 9
- Run last command ignores commands entered via arrow keystrokes HOT 1
- How do I get linter errors to be inline HOT 2
- Upgrade support for linter API to v2 HOT 19
- Uncaught TypeError: Cannot read property 'add' of null HOT 8
- Uncaught TypeError: this.registerIndie is not a function HOT 4
- Uncaught TypeError: Cannot read property 'length' of undefined HOT 1
- Replace errors from previous run only when the new run is finished HOT 4
- Linter errors not cleared in some cases. HOT 6
- sbt 1.0? HOT 5
- Uncaught TypeError: Cannot read property 'statusBarTile' of undefined HOT 2
- Uncaught TypeError: Cannot read property 'statusBarTile' of undefined HOT 1
- Automatically detect the sbt prompt
- Add unit tests
- Continuous run in play projects HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atom-sbt.