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

Macro for selected files in the project explorer #953

Closed
dhuebner opened this issue Apr 1, 2016 · 16 comments
Closed

Macro for selected files in the project explorer #953

dhuebner opened this issue Apr 1, 2016 · 16 comments
Assignees
Labels
kind/enhancement A feature request - must adhere to the feature request template.
Milestone

Comments

@dhuebner
Copy link

dhuebner commented Apr 1, 2016

It would be handy to have a macro that points to the current selected file (multiple files could be separated by a comma) in the package explorer:

e.g. ${explorer.selected}

https://eclipse-che.readme.io/docs/commands#macros

@ghost ghost added the Improvement label Apr 1, 2016
@TylerJewell
Copy link

It seems that the initial set of command macros that have been provided are somewhat limited right now. Let's go ahead and define a wider list of macros for inclusion.

${current.project.file} -- Currently selected file
${current.project.path}  -- Absolute path to the selected file
${current.project.relpath} -- Path relative to the /projects folder
${server.port.<port>} -- Returns protocol, hostname and port of a service registered with an EXPOSE port
${server.port.<port>.protocol} -- Returns protocol of a service registered with an EXPOSE port
${server.port.<port>.hostname} -- Returns hostname of a service registered with an EXPOSE port
${server.port.<port>.port} -- Returns port of a service registered with an EXPOSE port

** Note that <port> is the port that is exposed by the Dockerfile provided by the user.  But the port returned is the ephemeral port assigned by Docker to that server.

@ddementieva ddementieva added kind/enhancement A feature request - must adhere to the feature request template. and removed Improvement labels Jun 3, 2016
@juampe
Copy link

juampe commented Jun 30, 2016

If this is implemented, will be a big ergonomic enhancement for language scripting users

command: cd /projects/python && PYTHONUNBUFFERED=1 python ${current.project.file}
/bin/bash: ${current.project.file}: bad substitution

@TylerJewell
Copy link

@juampe - we are going to include the analysis and implementation of many of these into our next sprint.

@gazarenkov
Copy link
Contributor

better
${server.} -- Returns server by ref name and so on

@TylerJewell
Copy link

Proposed new specification:

${current.project.file} -- Currently selected file
${current.project.path}  -- Absolute path to the selected file
${current.project.relpath} -- Path relative to the /projects folder
${server.<port>} -- Returns protocol, hostname and port of an internal server
${server.<port>.protocol} -- Returns protocol of a service registered with an EXPOSE port
${server.<port>.hostname} -- Returns hostname of a service registered with an EXPOSE port
${server.<port>.port} -- Returns port of a service registered with an EXPOSE port
${server.<ref>} -- Returns protocol, hostname and port of an internal server
${server.<ref>.protocol} -- Returns protocol of a server registered by name
${server.<ref>.hostname} -- Returns hostname of a server registered by name
${server.<ref>.port} -- Returns port of a server registered by name

@sunix
Copy link
Contributor

sunix commented Jul 9, 2016

Hi,
Selected files in the the explorer and active open file in the editor are not the same. Should we have 2 different macros for these ?
Also, we should keep ${current.class.fqn} which is very useful for java project.

@TylerJewell
Copy link

Sure - please propose a syntax that makes sense given the specification above.

@gazarenkov
Copy link
Contributor

gazarenkov commented Jul 18, 2016

${server. <port>.*} 
AND
${server. <ref>.*} 

wont work together (no chance to resolve), lets remove server.<port>.* option

@gazarenkov
Copy link
Contributor

For a subject - yes, It is 2 different areas - editor and tree, so I think it should be like:

explorer.selected.* 
editor.current.*

@TylerJewell
Copy link

TylerJewell commented Jul 19, 2016

Updated syntax. @vzhukovskii - also since we are renaming some existing parameters, please still support the OLD parameters so that upgrades will not have migration issues.

${editor.current.file.name} -- Currently selected file in editor with context
${editor.current.file.path}  -- Absolute path to the selected file in editor with context
${editor.current.file.relpath} -- Path relative to the /projects folder in editor with context
${editor.current.project.name} -- Project name of the file currently selected in editor with context
${editor.current.project.type} -- Project type of the file currently selected in editor with context
${explorer.current.file.name} -- Currently selected file in project tree
${explorer.current.file.path}  -- Absolute path to the selected file in project tree
${explorer.current.file.relpath} -- Path relative to the /projects folder in project tree
${explorer.current.project.name} -- Project name of the file currently selected in explorer
${explorer.current.project.type} -- Project type of the file currently selected in explorer
${server.<name>} -- Returns protocol, hostname and port of an internal server
${server.<name>.protocol} -- Returns protocol of a server registered by name
${server.<name>.hostname} -- Returns hostname of a server registered by name
${server.<name>.port} -- Returns port of a server registered by name
${workspace.name} -- Returns the name of the workspace
${host.name} -- Returns the hostname of the underlying OS running Che native or its Docker daemon.
${host.ip} -- Returns the IP address of the underlying OS running Che native or its or Docker daemon.

@vzhukovs
Copy link
Contributor

vzhukovs commented Jul 19, 2016

@TylerJewell as for:

${explorer.current.project.file} -- Currently selected file in project tree
${explorer.current.project.path}  -- Absolute path to the selected file in project tree
${explorer.current.project.relpath} -- Path relative to the /projects folder in project tree

what should we provide if we'll have more than one selected file?

@TylerJewell
Copy link

Provide comma separated list of all files selected.

@TylerJewell
Copy link

@ashumilova - a customer today asked for the ability to configure a custom working directory for commands of a custom type. We provide this field for maven commands, but not custom commands. Is there value in adding this?

@TylerJewell
Copy link

@ashumilova @vzhukovskii - can you talk about where this issue is in the priority list for the upcoming sprints? We are coming up with additional macros - that each show some simple stuff. So want us to think about when this gets scheduled.

@ashumilova ashumilova added sprint/next status/info-needed More information is needed before the issue can move into the “analyzing” state for engineering. labels Aug 15, 2016
@vzhukovs vzhukovs added the status/in-progress This issue has been taken by an engineer and is under active development. label Aug 19, 2016
vzhukovs pushed a commit that referenced this issue Aug 19, 2016
#953: Move command property value providers to core API
@ashumilova ashumilova removed the status/info-needed More information is needed before the issue can move into the “analyzing” state for engineering. label Aug 20, 2016
@bmicklea bmicklea mentioned this issue Aug 20, 2016
89 tasks
@slemeur slemeur added this to the 4.7.0 milestone Aug 25, 2016
@JamesDrummond
Copy link
Contributor

@vzhukovskii Commit today without the following.
${host.name} -- Returns the hostname of the underlying OS running Che native or its Docker daemon.
${host.ip} -- Returns the IP address of the underlying OS running Che native or its or Docker daemon.

Discuss with Tyler later on how to do the above removed items.

@ashumilova
Copy link
Contributor

Added issue for host macros - #2230

vzhukovs pushed a commit that referenced this issue Aug 26, 2016
Created new macros to provide various information from basic part.

Includes:
${editor.current.file.name} -- Currently selected file in editor with context
${editor.current.file.path}  -- Absolute path to the selected file in editor with context
${editor.current.file.relpath} -- Path relative to the /projects folder in editor with context
${editor.current.project.name} -- Project name of the file currently selected in editor with context
${editor.current.project.type} -- Project type of the file currently selected in editor with context
${explorer.current.file.name} -- Currently selected file in project tree
${explorer.current.file.path}  -- Absolute path to the selected file in project tree
${explorer.current.file.relpath} -- Path relative to the /projects folder in project tree
${explorer.current.project.name} -- Project name of the file currently selected in explorer
${explorer.current.project.type} -- Project type of the file currently selected in explorer
${server.<name>} -- Returns protocol, hostname and port of an internal server
${server.<name>.protocol} -- Returns protocol of a server registered by name
${server.<name>.hostname} -- Returns hostname of a server registered by name
${server.<name>.port} -- Returns port of a server registered by name
${workspace.name} -- Returns the name of the workspace
@vzhukovs vzhukovs added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. status/pending-merge and removed status/in-progress This issue has been taken by an engineer and is under active development. labels Aug 26, 2016
vzhukovs pushed a commit that referenced this issue Aug 29, 2016
vzhukovs pushed a commit that referenced this issue Aug 29, 2016
vzhukovs pushed a commit that referenced this issue Aug 29, 2016
@vzhukovs vzhukovs removed status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. status/pending-merge labels Aug 29, 2016
JPinkney pushed a commit to JPinkney/che that referenced this issue Aug 17, 2017
…changes

eclipse-che#953: Move command property value providers to core API
JPinkney pushed a commit to JPinkney/che that referenced this issue Aug 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template.
Projects
None yet
Development

No branches or pull requests

10 participants