File tree Expand file tree Collapse file tree 7 files changed +28
-24
lines changed
main/kotlin/com/github/continuedev/continueintellijextension/continue
test/kotlin/com/github/continuedev/continueintellijextension/unit Expand file tree Collapse file tree 7 files changed +28
-24
lines changed Original file line number Diff line number Diff line change 99 ILLMLogger ,
1010} from "../index.js" ;
1111import { GlobalContext } from "../util/GlobalContext.js" ;
12+ import { getConfigYamlPath } from "../util/paths.js" ;
1213
1314import EventEmitter from "node:events" ;
1415import { Logger } from "../util/Logger.js" ;
@@ -346,6 +347,7 @@ export class ConfigHandler {
346347 return ;
347348 }
348349
350+ getConfigYamlPath ( ) ;
349351 const configFile = element ?. sourceFile ?? profile . profileDescription . uri ;
350352 await this . ide . openFile ( configFile ) ;
351353 }
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ class Ollama extends BaseLLM implements ModelInstaller {
161161 private static modelsBeingInstalledMutex = new Mutex ( ) ;
162162
163163 private fimSupported : boolean = false ;
164- private templateSupportsTools : boolean | undefined = undefined ;
164+
165165 private modelInfoPromise : Promise < void > | undefined = undefined ;
166166 private explicitContextLength : boolean ;
167167
@@ -240,11 +240,6 @@ class Ollama extends BaseLLM implements ModelInstaller {
240240 * it's a good indication the model supports FIM.
241241 */
242242 this . fimSupported = ! ! body ?. template ?. includes ( ".Suffix" ) ;
243-
244- // Check if model template supports tool calling (same pattern as .Suffix above)
245- if ( body ?. template ) {
246- this . templateSupportsTools = body . template . includes ( ".Tools" ) ;
247- }
248243 } )
249244 . catch ( ( e ) => {
250245 // console.warn("Error calling the Ollama /api/show endpoint: ", e);
@@ -516,12 +511,7 @@ class Ollama extends BaseLLM implements ModelInstaller {
516511 stream : options . stream ,
517512 // format: options.format, // Not currently in base completion options
518513 } ;
519- // Only include tools with user messages, and only if the template supports them
520- if (
521- options . tools ?. length &&
522- ollamaMessages . at ( - 1 ) ?. role === "user" &&
523- this . templateSupportsTools !== false
524- ) {
514+ if ( options . tools ?. length && ollamaMessages . at ( - 1 ) ?. role === "user" ) {
525515 chatOptions . tools = options . tools . map ( ( tool ) => ( {
526516 type : "function" ,
527517 function : {
Original file line number Diff line number Diff line change @@ -118,15 +118,12 @@ export function getConfigJsonPath(): string {
118118
119119export function getConfigYamlPath ( ideType ?: IdeType ) : string {
120120 const p = path . join ( getContinueGlobalPath ( ) , "config.yaml" ) ;
121- if ( ! fs . existsSync ( p ) && ! fs . existsSync ( getConfigJsonPath ( ) ) ) {
122- if ( ideType === "jetbrains" ) {
123- // https://github.com/continuedev/continue/pull/7224
124- // This was here because we had different context provider support between jetbrains and vs code
125- // Leaving so we could differentiate later but for now configs are the same between IDEs
126- fs . writeFileSync ( p , YAML . stringify ( defaultConfig ) ) ;
127- } else {
128- fs . writeFileSync ( p , YAML . stringify ( defaultConfig ) ) ;
129- }
121+ const exists = fs . existsSync ( p ) ;
122+ const isEmpty = exists && fs . readFileSync ( p , "utf8" ) . trim ( ) === "" ;
123+ const needsCreation = ! exists && ! fs . existsSync ( getConfigJsonPath ( ) ) ;
124+
125+ if ( needsCreation || isEmpty ) {
126+ fs . writeFileSync ( p , YAML . stringify ( defaultConfig ) ) ;
130127 setConfigFilePermissions ( p ) ;
131128 }
132129 return p ;
Original file line number Diff line number Diff line change 11pluginGroup =com.github.continuedev.continueintellijextension
2- pluginVersion =1.0.65
2+ pluginVersion =1.0.67
33platformVersion =2024.1
44kotlin.stdlib.default.dependency =false
55org.gradle.configuration-cache =true
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ object UriUtils {
2626 // Handle Windows file paths with authority component
2727 if (uriStr.startsWith(" file://" ) && ! uriStr.startsWith(" file:///" )) {
2828 val path = uriStr.substringAfter(" file://" )
29- return URI (" file:/// $path " )
29+ return URI (" file" , " " , " / $path " , null )
3030 }
3131
3232 return try {
Original file line number Diff line number Diff line change @@ -60,4 +60,19 @@ class UriUtilsTest : TestCase() {
6060 val expectedFile = File (" /path/to/file with spaces" )
6161 assertEquals(expectedFile, result)
6262 }
63+
64+ // Regression test for #10978 — bracket directories like [gamemode]
65+ fun `test square brackets in path` () {
66+ val uri = " file:///path/to/[gamemode]/file.lua"
67+ val result = UriUtils .uriToFile(uri)
68+ assertEquals(File (" /path/to/[gamemode]/file.lua" ), result)
69+ }
70+
71+ fun `test Windows path with square brackets` () {
72+ val uri = " file://C:/Users/user/projects/[gamemode]/file.lua"
73+ val parsed = UriUtils .parseUri(uri)
74+ assertEquals(" file" , parsed.scheme)
75+ assertEquals(" /C:/Users/user/projects/[gamemode]/file.lua" , parsed.path)
76+ assertEquals(" file:///C:/Users/user/projects/%5Bgamemode%5D/file.lua" , parsed.toString())
77+ }
6378}
Original file line number Diff line number Diff line change 22 "name" : " continue" ,
33 "icon" : " media/icon.png" ,
44 "author" : " Continue Dev, Inc" ,
5- "version" : " 1.3.36 " ,
5+ "version" : " 1.3.38 " ,
66 "repository" : {
77 "type" : " git" ,
88 "url" : " https://github.com/continuedev/continue"
You can’t perform that action at this time.
0 commit comments