Code Monkey home page Code Monkey logo

Comments (10)

marcdeop avatar marcdeop commented on May 18, 2024 1

Wohoo πŸŽ‰ :

npm install microsoft-compose-language-service-0.1.3-alpha.tgz 

added 7 packages, and audited 8 packages in 620ms

found 0 vulnerabilities

And then:

~/node_modules/\@microsoft/compose-language-service/bin/docker-compose-langserver  --stdio

Seems to be running :-)

from compose-language-service.

marcdeop avatar marcdeop commented on May 18, 2024 1

@bwateratmsft : I know the ticket is closed but I wanted to let you know everything seems to be working fine.

The main two places (here and here) are way simpler now and they seem to work.

Thanks a ton for the quick response and the solution!

from compose-language-service.

bwateratmsft avatar bwateratmsft commented on May 18, 2024

Thanks @marcdeop! This is an interesting idea. Are there other language services that are already doing this, that I could use as a reference?

from compose-language-service.

marcdeop avatar marcdeop commented on May 18, 2024

From the top of my head:

docker-anguage-server-nodejs
yaml-language-server
vim-language-server

Hopefully is enough to give you an idea :-)

from compose-language-service.

bwateratmsft avatar bwateratmsft commented on May 18, 2024

@marcdeop can you npm install the build for the PR? It's available here: https://dev.azure.com/ms-azuretools/AzCode/_build/results?buildId=58272&view=artifacts&pathAsName=false&type=publishedArtifacts. The download will come as a .ZIP which you can extract, and then do npm install /path/to/microsoft-compose-language-service-0.1.3-alpha.tgz. I think that's all these executables are supposed to be.

If that does work, I'll bump the version and release.

from compose-language-service.

marcdeop avatar marcdeop commented on May 18, 2024

So... a few issues:

npm install microsoft-compose-language-service/microsoft-compose-language-service-0.1.3-alpha.tgz                                                                                                                               
npm ERR! code 128                                                                                                                                                                                                                                            
npm ERR! An unknown git error occurred                                                                                                                                                                                                                       
npm ERR! command git --no-replace-objects ls-remote ssh://[email protected]/microsoft-compose-language-service/microsoft-compose-language-service-0.1.3-alpha.tgz.git                                                                                           
npm ERR! ERROR: Repository not found.                                                                                                                                                                                                                        
npm ERR! fatal: Could not read from remote repository.                                                                                                                                                                                                       
npm ERR!                                                                                                                                                                                                                                                     
npm ERR! Please make sure you have the correct access rights                                                                                                                                                                                                 
npm ERR! and the repository exists.                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                             
npm ERR! A complete log of this run can be found in:                                                                                                                                                                                                         
npm ERR!     /home/marc.deop-private/.npm/_logs/2023-02-13T20_15_20_345Z-debug-0.log

So I tried unpacking also the .tgz and running npm install inside.

The resulting file is not executable:

bin/docker-compose-langserver                          
-bash: bin/docker-compose-langserver: Permission denied

Nothing a chmod a+rx bin/docker-compose-langserver cannot fix.

Now:

./bin/docker-compose-langserver 
/usr/bin/env: β€˜node\r’: No such file or directory
/usr/bin/env: use -[v]S to pass options in shebang lines

Now I am confused πŸ˜–

EDIT:
I converted the file to unix format with dos2unix bin/docker-compose-langserver and now it executes but:

node:internal/modules/cjs/loader:998                                                                                                                                                                                                                         
  throw err;                                                                                                                                                                                                                                                 
  ^                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                             
Error: Cannot find module '../lib/server'                                                                                                                                                                                                                    
Require stack:                                                                                                                                                                                                                                               
- /home/marc.deop-private/tmp/compose-language-service/bin/docker-compose-langserver                                                                                                                                                                         
    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)                                                                                                                                                                                     
    at Module._load (node:internal/modules/cjs/loader:841:27)                                                                                                                                                                                                
    at Module.require (node:internal/modules/cjs/loader:1061:19)                                                                                                                                                                                             
    at require (node:internal/modules/cjs/helpers:103:18)                                                                                                                                                                                                    
    at Object.<anonymous> (/home/marc.deop-private/tmp/compose-language-service/bin/docker-compose-langserver:6:1)                                                                                                                                           
    at Module._compile (node:internal/modules/cjs/loader:1159:14)                                                                                                                                                                                            
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)                                                                                                                                                                                     
    at Module.load (node:internal/modules/cjs/loader:1037:32)                                                                                                                                                                                                
    at Module._load (node:internal/modules/cjs/loader:878:12)                                                                                                                                                                                                
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {                                                                                                                                                                  
  code: 'MODULE_NOT_FOUND',                                                                                                                                                                                                                                  
  requireStack: [                                                                                                                                                                                                                                            
    '/home/marc.deop-private/tmp/compose-language-service/bin/docker-compose-langserver'                                                                                                                                                                     
  ]                                                                                                                                                                                                                                                          
}                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                             
Node.js v18.12.1

from compose-language-service.

bwateratmsft avatar bwateratmsft commented on May 18, 2024

I think I know what happened; Git is surreptitiously adding \r in and it's causing problems. I've seen that happen before. I have a new build that should fix that part, at least: https://dev.azure.com/ms-azuretools/AzCode/_build/results?buildId=58275&view=artifacts&pathAsName=false&type=publishedArtifacts

The install failure is, I'm guessing, due to the weird stuff we have to do with namespacing to get it to play nice with NPM. Once it's published that shouldn't be an issue but I guess for testing you'll have to extract like you did 😞

I also added the bin entry to package.json which I'd forgotten to do before. I don't know for sure but that may (or may not) fix the permissions issue so chmod isn't needed.

from compose-language-service.

bwateratmsft avatar bwateratmsft commented on May 18, 2024

Interestingly, I was able to npm install the .tgz file--as long as I was in the same folder as it, not a parent folder. No idea why that is...once I did the npm install, it collects the necessary dependencies (e.g., vscode-languageserver, yaml, a few others) and seemed to work. Unpacking alone didn't work, though the error I got was different--missing vscode-languageserver.

from compose-language-service.

bwateratmsft avatar bwateratmsft commented on May 18, 2024

Hey @marcdeop, I just published 0.1.3 on NPM with these changes. Let us know if it works!

from compose-language-service.

bwateratmsft avatar bwateratmsft commented on May 18, 2024

Awesome! Glad we could help!

from compose-language-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.