-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(eclipse): include tabby-agent in package. (#2732)
* fix(eclipse): include tabby-agent in package. * chore(eclipse): format code.
- Loading branch information
Showing
8 changed files
with
118 additions
and
46 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 |
---|---|---|
@@ -1 +1,3 @@ | ||
dist | ||
node_modules | ||
plugin/tabby-agent |
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
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,11 @@ | ||
{ | ||
"name": "tabby4eclipse", | ||
"private": true, | ||
"scripts": { | ||
"postinstall": "node scripts/copy-tabby-agent.js" | ||
}, | ||
"devDependencies": { | ||
"tabby-agent": "workspace:*", | ||
"fs-extra": "^11.1.1" | ||
} | ||
} |
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
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ source.. = src/ | |
output.. = bin/ | ||
bin.includes = plugin.xml,\ | ||
META-INF/,\ | ||
tabby-agent/,\ | ||
.\ |
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 |
---|---|---|
|
@@ -16,23 +16,34 @@ | |
|
||
public class ConnectionProvider extends ProcessStreamConnectionProvider { | ||
private Logger logger = new Logger("ConnectionProvider"); | ||
|
||
public ConnectionProvider() { | ||
List<String> commands = List.of("npx", "[email protected]", "--stdio"); | ||
logger.info("Will use command " + commands.toString() + " to start Tabby language server."); | ||
this.setCommands(commands); | ||
try { | ||
Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID); | ||
URL agentScriptUrl = FileLocator.find(bundle, new Path("tabby-agent/dist/node/index.js")); | ||
if (agentScriptUrl == null) { | ||
logger.error("Cannot find tabby-agent script."); | ||
return; | ||
} | ||
File agentScriptFile = new File(FileLocator.toFileURL(agentScriptUrl).getPath()); | ||
List<String> commands = List.of("node", agentScriptFile.getAbsolutePath(), "--stdio"); | ||
logger.info("Will use command " + commands.toString() + " to start Tabby language server."); | ||
this.setCommands(commands); | ||
} catch (IOException e) { | ||
logger.error("Failed to setup command to start Tabby language server.", e); | ||
} | ||
} | ||
|
||
@Override | ||
public void start() throws IOException { | ||
super.start(); | ||
logger.info("Tabby language server started."); | ||
} | ||
|
||
@Override | ||
public void stop() { | ||
super.stop(); | ||
logger.info("Tabby language server stopped."); | ||
} | ||
|
||
} |
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,22 @@ | ||
#!/usr/bin/env node | ||
|
||
const fs = require('fs-extra'); | ||
const path = require('path'); | ||
|
||
const cwd = process.cwd(); | ||
const sourceDir = path.join(cwd, 'node_modules', 'tabby-agent', 'dist', 'node'); | ||
const targetDir = path.join(cwd, 'plugin', 'tabby-agent', 'dist', 'node'); | ||
|
||
async function copyFiles() { | ||
try { | ||
await fs.emptyDir(targetDir); | ||
await fs.copy(sourceDir, targetDir, { | ||
filter: (src) => !src.endsWith('.js.map') | ||
}); | ||
console.log('✅ Files copied: node_modules/tabby-agent/dist/node -> plugin/tabby-agent/dist/node'); | ||
} catch (err) { | ||
console.error('❌ Error copying files:', err); | ||
} | ||
} | ||
|
||
copyFiles(); |
Oops, something went wrong.