Giter VIP home page Giter VIP logo

Comments (28)

inkytonik avatar inkytonik commented on August 12, 2024 2

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.

inkytonik avatar inkytonik commented on August 12, 2024 1

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.

inkytonik avatar inkytonik commented on August 12, 2024 1

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.

inkytonik avatar inkytonik commented on August 12, 2024 1

Supported in version 0.9.0 which is now published.

from atom-sbt.

inkytonik avatar inkytonik commented on August 12, 2024

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.

laughedelic avatar laughedelic commented on August 12, 2024

I had in mind exactly what you described. It would be enough for at least how I use atom and sbt 👍

from atom-sbt.

laughedelic avatar laughedelic commented on August 12, 2024

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.

inkytonik avatar inkytonik commented on August 12, 2024

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.

laughedelic avatar laughedelic commented on August 12, 2024

OK!

from atom-sbt.

laughedelic avatar laughedelic commented on August 12, 2024

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.

inkytonik avatar inkytonik commented on August 12, 2024

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.

inkytonik avatar inkytonik commented on August 12, 2024

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.

inkytonik avatar inkytonik commented on August 12, 2024

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.

laughedelic avatar laughedelic commented on August 12, 2024

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.

inkytonik avatar inkytonik commented on August 12, 2024

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.

laughedelic avatar laughedelic commented on August 12, 2024

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.

laughedelic avatar laughedelic commented on August 12, 2024

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.

inkytonik avatar inkytonik commented on August 12, 2024

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.

laughedelic avatar laughedelic commented on August 12, 2024

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.

inkytonik avatar inkytonik commented on August 12, 2024

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.

inkytonik avatar inkytonik commented on August 12, 2024

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.

laughedelic avatar laughedelic commented on August 12, 2024

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.

laughedelic avatar laughedelic commented on August 12, 2024

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.

inkytonik avatar inkytonik commented on August 12, 2024

Also, linter V2 is now supported as of a22c61b. Please report problems on #16.

from atom-sbt.

laughedelic avatar laughedelic commented on August 12, 2024

Great! I will try out the latest master version.

from atom-sbt.

laughedelic avatar laughedelic commented on August 12, 2024

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.

inkytonik avatar inkytonik commented on August 12, 2024

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.

laughedelic avatar laughedelic commented on August 12, 2024

OK, I see. I'm fine with window-total. Just wanted to make sure it works as supposed.

from atom-sbt.

Related Issues (20)

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.