Git Product home page Git Product logo

Comments (6)

AbigailBuccaneer avatar AbigailBuccaneer commented on June 17, 2024

@Darkyenus this is fairly serious :(

from glsl4idea.

AbigailBuccaneer avatar AbigailBuccaneer commented on June 17, 2024

Okay, it looks like the cause is that GLSLParsing#parseFunctionIdentifier tries to parse a type specifier, and if it can then it assumes it's a constructor. But a single identifier is a valid type specifier (it's a reference to an existing struct type).

I think given this there's probably no sensible way to separate constructors and functions at the parsing level - that distinction should come higher up, when a function/constructor call would resolve to either a function declaration or struct name (and the return type would be based on that).

from glsl4idea.

Darkyenus avatar Darkyenus commented on June 17, 2024

Noticed during prerelease testing as well, fixed in 5680358. It is not ideal, since structures can have constructors as well.

from glsl4idea.

Darkyenus avatar Darkyenus commented on June 17, 2024

Yeah, I'll look into that later, for now it should work well enough. The problem is, that it needs a reliable way to tell whether the name of function call corresponds to defined structure. Is that possible? This seems vaguely related to your work around rename refactoring.

from glsl4idea.

AbigailBuccaneer avatar AbigailBuccaneer commented on June 17, 2024

I'm going to be doing even more work on references - it should be possible to reliably resolve the name to either a struct type or a function name.

from glsl4idea.

Darkyenus avatar Darkyenus commented on June 17, 2024

When I tested it now on master, the struct name refactoring didn't work yet, but valid code involving struct constructor was not highlighted as error. So I won't postpone the release because of it and the constructor related code can be refactored back into function calls in next release.

from glsl4idea.

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.