-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add support for opening file at a certain line+column via CLI #54
Comments
It would be great if there was also another CLI param that would ensure that this doesn't cause a new ecode process to start, but instead uses the existing one. |
This would be very useful, I'll implement it right away. Regarding the CLI options, you can invoke the help with the standard UNIX way: Current options are: ecode --help [file] {OPTIONS}
ecode
OPTIONS:
-h, --help Display this help menu
file The file or folder path
-f[file], --file=[file],
--folder=[file] The file or folder path
-d[pixel-density],
--pixel-density=[pixel-density] Set default application pixel density
-c[prefers-color-scheme],
--prefers-color-scheme=[prefers-color-scheme]
Set the preferred color scheme ("light"
or "dark")
--css=[css] Sets the path for a custom stylesheet to
load at the start of the application
-t, --terminal Open a new terminal
-l[log-level],
--log-level=[log-level] The level of details that the
application will emmit logs.
--fb, --framebuffer Use frame buffer (more memory usage,
less CPU usage)
--benchmark-mode Render as much as possible to measure
the rendering performance.
-v, --verbose Print all logs to the standard output.
-V, --version Prints version information
-j[jobs], --jobs=[jobs] Sets the number of background jobs that
the application will spawn at the start
of the application
--health Checks for potential errors in editor
setup.
--health-lang=[health-lang] Checks for potential errors in editor
setup for a specific language.
--health-format=[health-format] Sets the health format report (accepted
values: terminal, markdown, ascii,
asciidoc)
"--" can be used to terminate flag options and force all following
arguments to be treated as positional options (the health ones aren't available yet, that's for the next release =)) Regarding the single instance, I plan to implement it, but there's no standard way of doing it for a multi-platform application, and I was lazy to implement it, if possible, open a new issue for that request. Thanks |
Interestingly it looks like Unity has support for adding support for external code editors: So I can make a simple plugin for this soon. |
Related to this - it would also be nice to be able to pass in both "--folder" and "--file". This would result in the folder being opened and the file being opened and scrolled to the specified line number. |
I was thinking the same! I'll add it. I already verified that the help is not being printed on Windows but the command parameters work, I'll see what's happening. |
Created this issue to keep track of the other feature request. |
I'll publish a new build probably tomorrow. New options look like: ecode --help 03:42:56
[file_or_folder] {OPTIONS}
ecode
OPTIONS:
-h, -?, --help Display this help menu
file_or_folder The file or folder path to open
-f[file], --file=[file] The file path to open. A file path can
also contain the line number and column
to position the cursor when the file is
opened. The format is:
$FILEPATH:$LINE_NUMBER:$COLUMN. Both
line number and column are optional
(line number can be provided without
column too).
--folder=[folder] The folder path to open
-d[pixel-density],
--pixel-density=[pixel-density] Set default application pixel density
-c[prefers-color-scheme],
--prefers-color-scheme=[prefers-color-scheme]
Set the preferred color scheme ("light"
or "dark")
--css=[css] Sets the path for a custom stylesheet to
load at the start of the application
-t, --terminal Open a new terminal
-l[log-level],
--log-level=[log-level] The level of details that the
application will emmit logs.
--fb, --framebuffer Use frame buffer (more memory usage,
less CPU usage)
--benchmark-mode Render as much as possible to measure
the rendering performance.
-v, --verbose Print all logs to the standard output.
-V, --version Prints version information
-j[jobs], --jobs=[jobs] Sets the number of background jobs that
the application will spawn at the start
of the application
--health Checks for potential errors in editor
setup.
--health-lang=[health-lang] Checks for potential errors in editor
setup for a specific language.
--health-format=[health-format] Sets the health format report (accepted
values: terminal, markdown, ascii,
asciidoc)
"--" can be used to terminate flag options and force all following
arguments to be treated as positional options |
That's great!! Can't wait to try it. |
It does work! :) |
Confirmed this is working well! Massive improvement to usability from Unity! |
In Unity you can select any script editor to open the C# scripts...This is very useful for example for jumping to the line in the file that has a compile error or exception etc.
According to the docs:
These CLI parameters can be specified to jump to the correct file+line+column location. Usually the format for this is "file:line:column" where :line and :column are optional.
Is this something that could be supported in ecode (or perhaps already is)?
Also I couldn't find any CLI params in the docs or when typeing "ecode.exe -?" so perhaps some basic CLI improvement could be made here too..at least listing a basic help params.
The text was updated successfully, but these errors were encountered: