Git Product home page Git Product logo

Comments (12)

RBisges avatar RBisges commented on May 30, 2024

Sorry, I just noticed that in this case a semicolon after print will make the error disappear. But the script works fine with or without semicolon

from awk-language-server.

Beaglefoot avatar Beaglefoot commented on May 30, 2024

I can not replicate this with version 0.6.2. What version do you have?

from awk-language-server.

RBisges avatar RBisges commented on May 30, 2024

Same version. Trying to construct another test case which shows it more conclusively

from awk-language-server.

RBisges avatar RBisges commented on May 30, 2024

This here is from one of the scripts. It shows the same error, but at [7,6]

BEGINFILE {
    if( FILENAME ~ /\.csv$/ )
	{
		FS = ";";
		nCSV++;
	}
	else
	{
		FS = " ";
	}
}

from awk-language-server.

Beaglefoot avatar Beaglefoot commented on May 30, 2024

The second example also looks fine on my side.

I assume that you're on linux. Could you exec the following 3 commands and paste their output here?

  1. code --list-extensions --show-versions
  2. ~/.vscode/extensions/beaglefoot.awk-ide-vscode-?.?.?/node_modules/awk-language-server/out/cli.js --version
  3. md5sum ~/.vscode/extensions/beaglefoot.awk-ide-vscode-?.?.?/node_modules/awk-language-server/tree-sitter-awk.wasm

from awk-language-server.

RBisges avatar RBisges commented on May 30, 2024

Sorry, was in a meeting. Unfortunately I have to work on a windows machine for this. It seems that code on windows doesn't have the same cli. I tried to get the inormation in other ways.

VS-Code Version:
Version: 1.63.2 (user setup)
Commit: 899d46d82c4c95423fb7e10e68eba52050e30ba3
Date: 2021-12-15T09:40:02.816Z (2 wks ago)
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19043

I found your addin under <USER>\.vscode. I copied that from the manifest:

<Identity Language="en-US" Id="awk-ide-vscode" Version="0.6.2" Publisher="beaglefoot" />

I created the md5sum with Total Commander.

bc892463771af140d3e197bf99ac821d *tree-sitter-awk.wasm

I looked into package.json and it shows me 0.6.2 .

Still missing is the list of extensions and their versions. Searching for a way. But maybe it's just the OS which makes the difference here

from awk-language-server.

RBisges avatar RBisges commented on May 30, 2024

Found it finally. I had to use the code.cmd instead of the code.exe. Using said code.cmd it gave me the extensions

I will check this on a windows notebook with the same versions, but probably different vscode-addins

from awk-language-server.

Beaglefoot avatar Beaglefoot commented on May 30, 2024

Your versions and md5 sum are ok.

I checked examples above on box with windows both with mine and yours set of extensions and all is fine. Still cannot reproduce.

At this point I suspect that there might be several versions of vscode on your system. What if you run vscode from command line with just code.cmd you used earlier? Does the problem persists this way?

from awk-language-server.

Beaglefoot avatar Beaglefoot commented on May 30, 2024

Ok, I finally reproduced that and the reason is that on windows lines end with CRLF by default.

Here's quick fix:

  • Press Shift+Ctrl+P
  • Enter 'Change End of Line Sequence'
  • Select 'LF'

from awk-language-server.

RBisges avatar RBisges commented on May 30, 2024

I tried on my development notebook now. Different setup, same Windows version (21H1), same VS-Code version.
The effect is the same. I tried starting VS-Code via the code.cmd with no recognisable difference.
Another strange effect: If I change the position of the opening brace to be on the same line after "else", the warning is gone. But the colourization hints to the parser not recognising "else" as a syntax element.

BEGIN {
	nCSV = 0;
}

BEGINFILE {
    if( FILENAME ~ /\.csv$/ )
	{
		FS = ";";
		nCSV++;
	}
	else	{
		FS = " ";
	}
}

from awk-language-server.

RBisges avatar RBisges commented on May 30, 2024

Okay, that was a good catch. I'm used to similar problems since I often have to develop on QNX (RT-Unix) or Linux-systems. But I didn't think of it here.

Thank you very much

from awk-language-server.

Beaglefoot avatar Beaglefoot commented on May 30, 2024

That makes two of us 😄

Thanks for reporting.

from awk-language-server.

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.