microhobby / linuxkerneldev

Visual Studio Code extension to help find documentation, device tree matching on device driver source code, by compatible strings
MIT License
41 stars 9 forks source link

scripts: fix opening a new windows on finding #21

Closed suzakuwcx closed 1 year ago

suzakuwcx commented 1 year ago

Problem are occur with "Remote SSH" and "code-server"

for Remote SSH when searching linux kernel header file , for example <linux/netpoll.h>, extension will open a new windows with only this file, add option "-r" can prevent this.

for code-server image

the available command is code-server instead of code , I try to add

LinuxNativeCommands.ts:17

else if(vscode.env.appHost === 'server-distro') {
    this.insider = "code-server";
} 

it will debug success but build fail

microhobby commented 1 year ago

@suzakuwcx thanks for the contribution. Why are you using the vscode.env.appHost instead vscode.version? Is there no difference on the string returned by vscode.version between code and code-server?

suzakuwcx commented 1 year ago

@microhobby yes, API document here

Variables appHost: string The hosted location of the application On desktop this is 'desktop' In the web this is the specified embedder i.e. 'github.dev', 'codespaces', or 'web' if the embedder does not provide that information

for vscode.version it would return no different like '1.73.1', but for vscode.env.appHost, for Remote-SSH it would return 'desktop', for code-server it would return 'server-distro', the only strange thing is compiling failed ?

by the way, maybe vscode.env.appName can also be a judging condition, for the different return with 'Visual Studio Code' and 'code-server' .

microhobby commented 1 year ago

@suzakuwcx I will merge this and will open a new ticket to handle the code-server problem. Thanks for the contribution!