Git Product home page Git Product logo

language-client-vscode's People

Contributors

freaz avatar janhalama avatar lukas-valenta avatar theedward162 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

language-client-vscode's Issues

[BUG] Broken highlighting for multiline strings

Using multi-line strings breaks highlighting in various ways.

Expected Behavior

The string portion should be highlighted as such, with no effects on the surrounding (following) code.

Current Behavior

image
image
(In the second image, note the `response 200 "application/json" that's grey)

Steps to Reproduce

Open e.g. list-activities map for bokun: https://github.com/superfaceai/station/blob/feat/booking/grid/booking/list-activities/maps/bokun.suma

Your Environment

Extension v1.3.0

VS Code:

Version: 1.75.0
Commit: e2816fe719a4026ffa1ee0189dc89bdfdbafb164
Date: 2023-02-04T10:31:04.465Z
Electron: 19.1.9
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 5.15.91-4-lts
Sandboxed: No

[BUG] Map: Broken JavaScript highlighting in some contexts

Here's a map code I was able to reproduce the issue with:

map Usecase {
  http POST "/test" {
    request "application/json" {
      headers {
        accept = "application/json"
      }
    }
    response 201 "text/html" {
      return map error if (!body.startsWith("{"))
      {
        title = "Error creating reservation",
        cause = "unknown",
        detail = `${body}`,
      }
      
      return map result {
        bookingId = `${body.id_reservations}`
      }
    }
    response 500 {
      return map error if (body.includes("Overbooking")) {
        title = "Overbooking",
        cause = "overbooking",
        detail = `${body}`,
      }

      return map error {
        title = "Server error",
        cause = "unknown",
        detail = `${body}`,
      }
    }
  }
}

Expected Behavior

I'd expect all Jessie contexts to be highlighted as JavaScript (in result, e.g. bookingId = `${body.id_reservations}` or detail = `${body}`,).

Current Behavior

Some Jessie parts are highlighted differently, see lines 17 and 24 below:
image

Looking at the tokens inspection, I can see that line 13 gets correctly highlighted as JavaScript:

image

While line 17 is treated as comlink-map.

image

Steps to Reproduce

  1. Open a new Comlink Map in VSCode
  2. Paste the code above

Your Environment

VS Code 1.70.2 on Fedora Linux 36 (official RPM package).

Profile highlighting breaks when safety is specified

The following profile high lighting works just fine:

profile = "StarWars/CharacterInformation"

usecase RetrieveCharacterInformation safe {
  input {
    characterName
  }
  
  result {
    height
    weight
    yearOfBirth
  }
}

However, when a safety safe is added, the highlighting breaks:

profile = "StarWars/CharacterInformation"

usecase RetrieveCharacterInformation safe {
  input {
    characterName
  }
  
  result {
    height
    weight
    yearOfBirth
  }
}

Map comments are not correctly highlighted

See attached screenshots

Screen Shot 2020-12-29 at 12 18 26

Screen Shot 2020-12-29 at 12 18 36

Full map in question:

profile = "StarWars/CharacterInformation"
provider = "swapidev"

map RetrieveCharacterInformation {

  http GET "/people/" {
    request {
      query {
        search = input.characterName
      }
    }

    response 200 "application/json" {
      return map error if (body.count === 0)  {
        message = "no character found"
      }
      
      // map error if (!body.count || !body.results) {}

      set {
        entry = body.results.filter((result) => result.name === input.characterName)
        character = (entry && entry.length > 0) ? entry[0] : undefined
      }

      map error if (character === undefined) {
        message = "not found" 
      }

      map result if (character) {
        name = character.name
        height = character.height
        weight = character.mass
        yearOfBirth = character.birth_year
      }
    }
  }
}

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.