Comments (17)
code ~/code/myrepo ~/code/myrepo/src/myfile.java
Works as far as I'm aware.
from starfix.
from starfix.
idea:
ide://clone?repo=[url]&path=src/main/java/test.java
clone if necessary, open file path
ide://clone?open=https://github.com/starfixdev/starfix/blob/master/cli/installer/windows/installer/starfix.reg
and have "magic parsing" that detects this is a github backed url and do the right clooning and open.
similar can be done for bitbucket, gitlab, etc..
from starfix.
example patterns for gitlab, github etc. can be found at https://github.com/jbangdev/jbang/blob/478f0c8202ea189362fac80fde5a02f3e7bd1fb5/src/main/java/dev/jbang/util/Util.java
from starfix.
first step: clone/reuse repo and open file path
second step: handle case where branch does not match or file might not exist locally
from starfix.
I tried working with VS Code.
Vs Code provides code
command to work from Terminal.
C:\Users\Fahad Israr>code --help
Visual Studio Code 1.57.1
Usage: code.exe [options][paths...]
To read output from another program, append '-' (e.g. 'echo Hello World | code.exe -')
Options
-d --diff <file> <file> Compare two files with each other.
-a --add <folder> Add folder(s) to the last active window.
-g --goto <file:line[:character]> Open a file at the path on the specified
line and character position.
-n --new-window Force to open a new window.
-r --reuse-window Force to open a file or folder in an
already opened window.
-w --wait Wait for the files to be closed before
returning.
--locale <locale> The locale to use (e.g. en-US or zh-TW).
--user-data-dir <dir> Specifies the directory that user data is
kept in. Can be used to open multiple
distinct instances of Code.
-h --help Print usage.
- Using the -g argument we can open the file on a specific line and character but the issue is its opening individually.
- We can use --n or -r to decide to open a new window or reuse the existing one but either way the file opens up individually without the rest of the project.
- If we intend to open the file only then this works fine otherwise will have to think of some other solution.
from starfix.
Oh wow.. that worked !!
I wasn't aware of that and was just trying things from the vscode cli help .
from starfix.
- Whenever we write something like this
ide://clone?open=https://github.com/starfixdev/starfix/blob/master/cli/installer/windows/installer/starfix.reg
starfix application will tell us it as an invalid argument. - To make this work we can write
starfix clone https://github.com/starfixdev/starfix/blob/master/cli/installer/windows/installer/starfix.reg
. - To achieve this we'd have to pre-process this into something like
starfix clone https://git.....
.Parsing in Java is easy but I ain't sure how'd I validate it with Picocli . I am currently exploring Picocli docs to see if I can find something helpful there.
from starfix.
Is this not just because the command does not have first argument defined ?
i.e. add the following:
@CommandLine.Parameters()
URI uri;
@Override
public void run() {
System.out.println(uri);
}
and it will let you pass the URI in as first free argument.
from starfix.
We have the first argument defined right ?
Aren't clone
and config
the first arguments ?
from starfix.
Yes but you can other option which will work when it is not clone or config.
from starfix.
- This will lead us to have something like this :
@Command(name = "clone"){
// Into Clone Command
}
@Command(name = "config) {
// Into Config Command
}
@CommandLine.Parameters()
URI uri;
@Override
public void run() {
System.out.println(uri);
}
- With this structure picocli will always expect a parameter.
- For instance, lets execute :
starfix clone https://git/user/repo
. This is what we get:
Missing required parameter: '<uri>'
Usage: <main class> [-hV] <uri> [COMMAND]
<uri>
-h, --help Show this help message and exit.
-V, --version Print version information and exit.
Commands:
clone
config
from starfix.
I was wondering if Picocli provides something like we have for switch case in Java.
switch(var)
case "clone":
case "config":
default:
{
// ide handler can fit in here
}
from starfix.
Mark the Uri parameter as optional. Then it is not required. See picocli Docs for the syntax.
from starfix.
- Yes yes,that's what I was searching for but read through somewhere in the Picocli that single valued parameters are mandatory
- Recently learnt about setting arity , probably setting it can make it optional. I am trying with that .
from starfix.
I had made changes to the PR yesterday.
Have a look if it looks fine.
from starfix.
Can close this issue ?
from starfix.
Related Issues (20)
- Installation failed in windows. HOT 6
- update docs to include link to download starfix build. HOT 2
- Build failing on Windows HOT 9
- Versioning and Changelogs HOT 4
- Manifest V3 HOT 7
- Setup release mechanism to Homebrew/Sdkman after a stable release
- not able to apply Defaut configuration after applying custom configuration HOT 1
- Provide default config for Mac OS HOT 3
- Github Actions Build and Verify Process not running on Pull Request
- Investigate eclipse+command url handler HOT 4
- support emacsclient HOT 2
- File Name with Spaces: An uresolved testcase from Closed Issue#61
- Add Tests HOT 2
- Custom Launch Command for IDE HOT 2
- Failed to run Starfix (Native Binary ) HOT 1
- Try to setup Release Mechanism for Browser Extension HOT 5
- .config missing on windows.
- create directory if not exist on clone HOT 3
- setup osx signing HOT 4
- The browser extension doesn't do anything if the default configuration have not been set. HOT 8
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 starfix.