-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/754-processable-output-bullet-proof
- Loading branch information
Showing
3 changed files
with
79 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,16 +11,51 @@ public enum GitUrlSyntax { | |
/** | ||
* The DEFAULT Git URL syntax | ||
*/ | ||
DEFAULT(""), | ||
DEFAULT("") { | ||
@Override | ||
public GitUrl format(GitUrl gitUrl) { | ||
return gitUrl; // No conversion for DEFAULT | ||
} | ||
}, | ||
/** | ||
* The SSH Git URL syntax (e.g., [email protected]:user/repo.git). | ||
*/ | ||
SSH("git@"), | ||
SSH("git@") { | ||
@Override | ||
public GitUrl format(GitUrl gitUrl) { | ||
String url = gitUrl.url(); | ||
if (isDomainWithNoConversion(url.toLowerCase())) { | ||
return gitUrl; | ||
} | ||
if (url.startsWith(HTTPS.prefix)) { | ||
int index = url.indexOf("/", HTTPS.prefix.length()); | ||
if (index > 0) { | ||
url = SSH.prefix + url.substring(HTTPS.prefix.length(), index) + ":" + url.substring(index + 1); | ||
} | ||
} | ||
return new GitUrl(url, gitUrl.branch()); | ||
} | ||
}, | ||
|
||
/** | ||
* The HTTPS Git URL syntax (e.g., https://github.com/user/repo.git). | ||
*/ | ||
HTTPS("https://"); | ||
HTTPS("https://") { | ||
@Override | ||
public GitUrl format(GitUrl gitUrl) { | ||
String url = gitUrl.url(); | ||
if (isDomainWithNoConversion(url.toLowerCase())) { | ||
return gitUrl; | ||
} | ||
if (url.startsWith(SSH.prefix)) { | ||
int index = url.indexOf(":"); | ||
if (index > 0) { | ||
url = HTTPS.prefix + url.substring(SSH.prefix.length(), index) + "/" + url.substring(index + 1); | ||
} | ||
} | ||
return new GitUrl(url, gitUrl.branch()); | ||
} | ||
}; | ||
|
||
private final String prefix; | ||
|
||
|
@@ -40,41 +75,9 @@ public enum GitUrlSyntax { | |
* @return the formatted {@link GitUrl} according to this syntax. | ||
* @throws IllegalArgumentException if the protocol is not supported. | ||
*/ | ||
public GitUrl format(GitUrl gitUrl) { | ||
if (this == DEFAULT) { | ||
return gitUrl; | ||
} | ||
String url = gitUrl.url(); | ||
|
||
// Prevent conversion for domains in the no-conversion list | ||
if (isDomainWithNoConversion(url.toLowerCase())) { | ||
return gitUrl; | ||
} | ||
|
||
switch (this) { | ||
case SSH -> { | ||
if (url.startsWith(HTTPS.prefix)) { | ||
int index = url.indexOf("/", HTTPS.prefix.length()); | ||
if (index > 0) { | ||
url = SSH.prefix + url.substring(HTTPS.prefix.length(), index) + ":" + url.substring(index + 1); | ||
} | ||
} | ||
} | ||
case HTTPS -> { | ||
if (url.startsWith(SSH.prefix)) { | ||
int index = url.indexOf(":"); | ||
if (index > 0) { | ||
url = HTTPS.prefix + url.substring(SSH.prefix.length(), index) + "/" + url.substring(index + 1); | ||
} | ||
} | ||
} | ||
default -> throw new IllegalArgumentException("Unsupported protocol: " + this); | ||
} | ||
|
||
return new GitUrl(url, gitUrl.branch()); | ||
} | ||
public abstract GitUrl format(GitUrl gitUrl); | ||
|
||
private boolean isDomainWithNoConversion(String url) { | ||
private static boolean isDomainWithNoConversion(String url) { | ||
|
||
for (String domain : DOMAINS_WITH_NO_CONVERSION) { | ||
// Check if it's an HTTPS URL for the domain | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
:toc: | ||
toc::[] | ||
|
||
= Coding Assistant | ||
The Coding Assistant is an AI-powered tool that helps you write and edit code more efficiently. | ||
It offers features like code suggestions, autocompletion, and error detection, improving productivity and reducing mistakes. | ||
It can be easily integrated into your development environment for smarter coding support. | ||
|
||
== Continue | ||
Continue is a leading open-source AI code assistant. | ||
It comes with features like https://docs.continue.dev/chat/how-to-use-it[Chat], https://docs.continue.dev/autocomplete/how-to-use-it[Autocomplete], https://docs.continue.dev/edit/how-to-use-it[Edit] and https://docs.continue.dev/actions/how-to-use-it[Actions]. | ||
Currently, the plugin is available for Intellij and VSCode. | ||
With IDEasy, we aim to keep the configuration process simple and provide the option to pre-configure the code assistant via https://github.com/devonfw/ide-settings[ide-settings] | ||
|
||
A possible pre-configuration file can be found here: https://github.com/devonfw/ide-settings/workspace/update/.continuerc.json[.continuerc.json] | ||
|
||
The config is set so that your model runs via `vllm`. | ||
The only action you have to take is to override the `apiBase` key with your server url. | ||
Telemetry is also disabled by default. | ||
There is a variety of different configurations that can be done with `continue` plugin. | ||
You can find the latest information and documentation here: https://docs.continue.dev/ | ||
``` | ||
{ | ||
"models": [ | ||
{ | ||
"title": "My vLLM OpenAI-compatible server", | ||
"apiBase": "http://localhost:8000/v1" | ||
} | ||
], | ||
|
||
"allowAnonymousTelemetry": false | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters