Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go sample can't run files without task #14007

Closed
sparkoo opened this issue Jul 24, 2019 · 7 comments
Closed

Go sample can't run files without task #14007

sparkoo opened this issue Jul 24, 2019 · 7 comments
Assignees
Labels
area/editor/theia Issues related to the che-theia IDE of Che area/languages Issues related to Language extensions or plugins integration. kind/bug Outline of a bug - must adhere to the bug report template.
Milestone

Comments

@sparkoo
Copy link
Member

sparkoo commented Jul 24, 2019

Is your task related to a problem? Please describe.

Our golang devfile (https://github.com/eclipse/che-devfile-registry/tree/master/devfiles/go) uses https://github.com/golang/example.git as a sample project. It has many runnable files with func main(), but we have only tasks for outyet subproject. AFAIK there is no way how to run Go file from IDE. Some languages can run files with little Run | Debug hovering over the runnable function, bug in Go, this does not work. So only way how to run files is by running terminal and write commands. I would consider this as not good IDE user experience.

Describe the solution you'd like

  • we should consider to use simpler Go sample with only one runnable file.
  • there should be way to run Go file with func main().

Describe alternatives you've considered

  • do nothing, user can run files from terminal
  • add more tasks
@sparkoo sparkoo added the kind/task Internal things, technical debt, and to-do tasks to be performed. label Jul 24, 2019
@slemeur slemeur added area/editor/theia Issues related to the che-theia IDE of Che area/languages Issues related to Language extensions or plugins integration. kind/enhancement A feature request - must adhere to the feature request template. team/languages and removed kind/task Internal things, technical debt, and to-do tasks to be performed. labels Jul 24, 2019
@slemeur slemeur added this to the 7.x milestone Jul 24, 2019
@slemeur
Copy link
Contributor

slemeur commented Jul 24, 2019

Could the command be parameterized so it take the file name? We used to have that in the commands macro?
cc @RomanNikitenko and @azatsarynnyy

@azatsarynnyy
Copy link
Member

Yes, it can be parameterized.
I think the best solution would be adding Run CodeLens support for func main() into VS Code Go extension upstream project.

@sparkoo
Copy link
Member Author

sparkoo commented Jul 25, 2019

@azatsarynnyy that would be awesome. parametrized task is ok for now, I guess

@slemeur
Copy link
Contributor

slemeur commented Jul 26, 2019

@azatsarynnyy Could you please show how to configure that task to @sparkoo ?

@slemeur
Copy link
Contributor

slemeur commented Jul 26, 2019

I don't think it's something very costly so we should take it as part of the 7.0 or 7.1
@rhopp : as you are triager today, I rely on you ;)

@azatsarynnyy
Copy link
Member

@slemeur @sparkoo
a command for running the current file can look like the following:

        }
            "type": "che",
            "label": "run current file",
            "command": "go get -d && go run ${file}",
            "target": {
                "containerName": "go-cli"
            }
        }

FYI all the variables that can be processed by the substitution mechanism are available through Variable: List All command in Theia commands palette.

Note, resolving the variables in the command property for che tasks will come with the PR eclipse-che/che-theia#373

@slemeur slemeur added kind/bug Outline of a bug - must adhere to the bug report template. and removed kind/enhancement A feature request - must adhere to the feature request template. labels Jul 26, 2019
@slemeur
Copy link
Contributor

slemeur commented Jul 26, 2019

I'm labelling this issue as bug (as misconfiguration of the command).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/editor/theia Issues related to the che-theia IDE of Che area/languages Issues related to Language extensions or plugins integration. kind/bug Outline of a bug - must adhere to the bug report template.
Projects
None yet
Development

No branches or pull requests

4 participants