Skip to content

Syntax highliting issue with this file #1052

Open

Description

Type: Bug

syntax highliting is not working properly for this file

VS Code version: Code 1.96.4 (Universal) (cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba, 2025-01-16T00:16:19.038Z)
OS version: Darwin arm64 24.2.0
Modes:

System Info
Item Value
CPUs Apple M1 (8 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 2, 2, 2
Memory (System) 8.00GB (0.07GB free)
Process Argv --crash-reporter-id 9073b22e-61a9-4835-8b76-26fbf9fe0b42
Screen Reader no
VM 0%
Extensions (15)
Extension Author (truncated) Version
path-intellisense chr 2.10.0
gitlens eam 16.2.1
prettier-vscode esb 11.0.0
vscode-jest-runner fir 0.4.74
auto-rename-tag for 0.1.10
copilot Git 1.260.0
copilot-chat Git 0.23.2
todo-tree Gru 0.0.226
search-node-modules jas 1.3.0
rainbow-csv mec 3.15.1
vscode-typescript-next ms- 5.8.20250129
quicktype qui 23.0.170
code-spell-checker str 4.0.34
quokka-vscode Wal 1.0.699
vscode-js-console-utils wht 0.7.0
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupytercf:31046870
nativerepl1:31139838
pythonrstrctxt:31112756
nativeloc2:31192216
cf971741:31144450
iacca1:31171482
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530
6074i472:31201624
dwoutputs:31217127
9064b325:31222308
copilot_t_ci:31222730

Activity

  1. octopols commented on Jan 30, 2025

    @octopols
    Author
    import {
      ApiHelperV2,
      ErrorCodes,
      FunctionResponse,
      FunctionResponseHelper,
    } from '@bikdotai/bik-shared-backend/lib/apis';
    import {
      AddBspOnboardingEventRequest,
      BSP_ERROR_MESSAGE_PREFIX,
      ErrorStates,
      FetchBspOnboardingEventRequest,
      FetchBspOnboardingEventResponse,
      AddSolutionIdRequest,
      FetchSolutionIdRequest,
      FetchSolutionIdResponse,
      BspCredentialsKeys,
      ConfigureWebhookUrlRequest,
      GenerateApiKeysRequest,
      FetchApiKeysRequest,
      WebhookInfo,
      AddBspOnboardingEventResponse,
      AddSolutionIdResponse,
      ConfigureWebhookUrlResponse,
      AccountInfo,
    } from './bsp.model';
    import { BspService } from './bsp.service';
    
    export class BspApi {
      bspService: BspService;
    
      saveOnboardingEvents = ApiHelperV2.using<
        AddBspOnboardingEventRequest,
        AddBspOnboardingEventResponse
      >(async (body) => {
        try {
          if (!body || !body.storeId || !body.task) {
            return ApiHelperV2.missingParameters();
          }
          this.bspService = new BspService();
          const saveOnboardingEventsResponse: FunctionResponse<AddBspOnboardingEventResponse> =
            await this.bspService.saveOnboardingEvents(body);
          return ApiHelperV2.success(saveOnboardingEventsResponse);
        } catch (err) {
          const errorMessage = `Error in saveOnboardingEvents \n Payload: ${JSON.stringify(
            body
          )} \n Error: ${err}`;
          console.error(errorMessage);
          return ApiHelperV2.callFailed(
            ErrorCodes.INTERNAL_SERVER_ERROR,
            FunctionResponseHelper.failed(
              ErrorCodes.INTERNAL_SERVER_ERROR,
              `${BSP_ERROR_MESSAGE_PREFIX} ${ErrorStates.INTERNAL_SERVER_ERROR}`
            )
          );
        }
      });
    
      fetchOnboardingEvents = ApiHelperV2.using<
        FetchBspOnboardingEventRequest,
        FetchBspOnboardingEventResponse
      >(async (body) => {
        try {
          if (!body || !body.storeId) {
            return ApiHelperV2.missingParameters();
          }
          this.bspService = new BspService();
          const fetchOnboardingEventsResponse: FunctionResponse<FetchBspOnboardingEventResponse> =
            await this.bspService.fetchOnboardingEvents(body);
          return ApiHelperV2.success(fetchOnboardingEventsResponse);
        } catch (err) {
          const errorMessage: string = `Error in fetchOnboardingEvents \n Payload: ${JSON.stringify(
            body
          )} \n Error: ${err}`;
          console.error(errorMessage);
          return ApiHelperV2.callFailed(
            ErrorCodes.INTERNAL_SERVER_ERROR,
            FunctionResponseHelper.failed(
              ErrorCodes.INTERNAL_SERVER_ERROR,
              `${BSP_ERROR_MESSAGE_PREFIX} ${ErrorStates.INTERNAL_SERVER_ERROR}`
            )
          );
        }
      });
    
      addSolutionId = ApiHelperV2.using<AddSolutionIdRequest, AddSolutionIdResponse>(async (body) => {
        try {
          if (!body || !body.storeId || !body.solutionId) {
            return ApiHelperV2.missingParameters();
          }
          this.bspService = new BspService();
          const addSolutionIdResponse: FunctionResponse<AddSolutionIdResponse> =
            await this.bspService.addSolutionId(body);
          return ApiHelperV2.success(addSolutionIdResponse);
        } catch (err) {
          const errorMessage: string = `Error in addSolutionId \n Payload: ${JSON.stringify(
            body
          )} \n Error: ${err}`;
          console.error(errorMessage);
          return ApiHelperV2.callFailed(
            ErrorCodes.INTERNAL_SERVER_ERROR,
            FunctionResponseHelper.failed(
              ErrorCodes.INTERNAL_SERVER_ERROR,
              `${BSP_ERROR_MESSAGE_PREFIX} ${ErrorStates.INTERNAL_SERVER_ERROR}`
            )
          );
        }
      });
    
      fetchSolutionId = ApiHelperV2.using<FetchSolutionIdRequest, FetchSolutionIdResponse>(
        async (body) => {
          try {
            if (!body || !body.storeId) {
              return ApiHelperV2.missingParameters();
            }
            this.bspService = new BspService();
            const fetchSolutionIdResponse: FunctionResponse<FetchSolutionIdResponse> =
              await this.bspService.fetchSolutionId(body);
            return ApiHelperV2.success(fetchSolutionIdResponse);
          } catch (err) {
            const errorMessage: string = `Error in fetchSolutionId \n Payload: ${JSON.stringify(
              body
            )} \n Error: ${err}`;
            console.error(errorMessage);
            return ApiHelperV2.callFailed(
              ErrorCodes.INTERNAL_SERVER_ERROR,
              FunctionResponseHelper.failed(
                ErrorCodes.INTERNAL_SERVER_ERROR,
                `${BSP_ERROR_MESSAGE_PREFIX} ${ErrorStates.INTERNAL_SERVER_ERROR}`
              )
            );
          }
        }
      );
    
      generateApiKeys = ApiHelperV2.using<GenerateApiKeysRequest, BspCredentialsKeys>(async (body) => {
        try {
          if (!body || !body.storeId) {
            return ApiHelperV2.missingParameters();
          }
          this.bspService = new BspService();
          const generateApiKeysResponse: FunctionResponse<BspCredentialsKeys> =
            await this.bspService.generateApiKeys(body);
          return ApiHelperV2.success(generateApiKeysResponse);
        } catch (err) {
          const errorMessage: string = `Error in generateApiKeys \n Payload: ${JSON.stringify(
            body
          )} \n Error: ${err}`;
          console.error(errorMessage);
          return ApiHelperV2.callFailed(
            ErrorCodes.INTERNAL_SERVER_ERROR,
            FunctionResponseHelper.failed(
              ErrorCodes.INTERNAL_SERVER_ERROR,
              `${BSP_ERROR_MESSAGE_PREFIX} ${ErrorStates.INTERNAL_SERVER_ERROR}`
            )
          );
        }
      });
    
      fetchApiKeys = ApiHelperV2.using<FetchApiKeysRequest, BspCredentialsKeys>(async (body) => {
        try {
          if (!body || !body.storeId) {
            return ApiHelperV2.missingParameters();
          }
          this.bspService = new BspService();
          const fetchApiKeysResponse: FunctionResponse<BspCredentialsKeys> =
            await this.bspService.fetchApiKeys(body);
          return ApiHelperV2.success(fetchApiKeysResponse);
        } catch (err) {
          const errorMessage: string = `Error in fetchApiKeys \n Payload: ${JSON.stringify(
            body
          )} \n Error: ${err}`;
          console.error(errorMessage);
          return ApiHelperV2.callFailed(
            ErrorCodes.INTERNAL_SERVER_ERROR,
            FunctionResponseHelper.failed(
              ErrorCodes.INTERNAL_SERVER_ERROR,
              `${BSP_ERROR_MESSAGE_PREFIX} ${ErrorStates.INTERNAL_SERVER_ERROR}`
            )
          );
        }
      });
    
      configureWebhookUrl = ApiHelperV2.using<ConfigureWebhookUrlRequest, ConfigureWebhookUrlResponse>(
        async (body) => {
          try {
            if (!body || !body.storeId || !body.webhookInfo) {
              return ApiHelperV2.missingParameters();
            }
            this.bspService = new BspService();
            const configureWebhookUrlResponse: FunctionResponse<ConfigureWebhookUrlResponse> =
              await this.bspService.configureWebhookUrl(body);
            return ApiHelperV2.success(configureWebhookUrlResponse);
          } catch (err) {
            const errorMessage: string = `Error in configureWebhookUrl \n Payload: ${JSON.stringify(
              body
            )} \n Error: ${err}`;
            console.error(errorMessage);
            return ApiHelperV2.callFailed(
              ErrorCodes.INTERNAL_SERVER_ERROR,
              FunctionResponseHelper.failed(
                ErrorCodes.INTERNAL_SERVER_ERROR,
                `${BSP_ERROR_MESSAGE_PREFIX} ${ErrorStates.INTERNAL_SERVER_ERROR}`
              )
            );
          }
        }
      );
    
      fetchWebhookUrl = ApiHelperV2.using<FetchBspOnboardingEventRequest, WebhookInfo>(async (body) => {
        try {
          if (!body || !body.storeId) {
            return ApiHelperV2.missingParameters();
          }
    
          this.bspService = new BspService();
          const fetchWebhookUrlResponse: FunctionResponse<WebhookInfo> =
            await this.bspService.fetchWebhookUrl(body.storeId);
          return ApiHelperV2.success(fetchWebhookUrlResponse);
        } catch (err) {
          const errorMessage: string = `Error in fetchWebhookUrl \n Payload: ${JSON.stringify(
            body
          )} \n Error: ${err}`;
          console.error(errorMessage);
          return ApiHelperV2.callFailed(
            ErrorCodes.INTERNAL_SERVER_ERROR,
            FunctionResponseHelper.failed(
              ErrorCodes.INTERNAL_SERVER_ERROR,
              `${BSP_ERROR_MESSAGE_PREFIX} ${ErrorStates.INTERNAL_SERVER_ERROR}`
            )
          );
        }
      });
    
      fetchAccountDetails = ApiHelperV2.using<FetchBspOnboardingEventRequest, AccountInfo>(
        async (body) => {
          try {
            if (!body || !body.storeId) {
              return ApiHelperV2.missingParameters();
            }
            this.bspService = new BspService();
            const fetchAccountDetailsResponse: FunctionResponse<AccountInfo> =
              await this.bspService.fetchAccountDetails(body.storeId);
            return ApiHelperV2.success(fetchAccountDetailsResponse);
          } catch (err) {
            const errorMessage: string = `Error in fetchAccountDetails \n Payload: ${JSON.stringify(
              body
            )} \n Error: ${err}`;
            console.error(errorMessage);
            return ApiHelperV2.callFailed(
              ErrorCodes.INTERNAL_SERVER_ERROR,
              FunctionResponseHelper.failed(
                ErrorCodes.INTERNAL_SERVER_ERROR,
                `${BSP_ERROR_MESSAGE_PREFIX} ${ErrorStates.INTERNAL_SERVER_ERROR}`
              )
            );
          }
        }
      );
    
      fetchActivePhoneNumbers = ApiHelperV2.using<FetchBspOnboardingEventRequest, number>(
        async (body) => {
          try {
            if (!body || !body.storeId) {
              return ApiHelperV2.missingParameters();
            }
            this.bspService = new BspService();
            const fetchActivePhoneNumbersResponse: FunctionResponse<number> =
              await this.bspService.fetchActivePhoneNumbers(body.storeId);
            return ApiHelperV2.success(fetchActivePhoneNumbersResponse);
          } catch (err) {
            const errorMessage: string = `Error in fetchActivePhoneNumbers \n Payload: ${JSON.stringify(
              body
            )} \n Error: ${err}`;
            console.error(errorMessage);
            return ApiHelperV2.callFailed(
              ErrorCodes.INTERNAL_SERVER_ERROR,
              FunctionResponseHelper.failed(
                ErrorCodes.INTERNAL_SERVER_ERROR,
                `${BSP_ERROR_MESSAGE_PREFIX} ${ErrorStates.INTERNAL_SERVER_ERROR}`
              )
            );
          }
        }
      );
    
      functions = {
        saveOnboardingEvents: this.saveOnboardingEvents,
        fetchOnboardingEvents: this.fetchOnboardingEvents,
        addSolutionId: this.addSolutionId,
        fetchSolutionId: this.fetchSolutionId,
        generateApiKeys: this.generateApiKeys,
        fetchApiKeys: this.fetchApiKeys,
        configureWebhookUrl: this.configureWebhookUrl,
        fetchWebhookUrl: this.fetchWebhookUrl,
        fetchAccountDetails: this.fetchAccountDetails,
        fetchActivePhoneNumbers: this.fetchActivePhoneNumbers,
      };
    }
    
    const bspApi = new BspApi();
    module.exports.bspApiFunctions = bspApi.functions;
  2. osortega commented on Jan 30, 2025

    @osortega

    Highlighting seems to be working fine for me, could you please elaborate more on the issue you are facing and provide repro steps?
     
    /needsMoreInfo

  3. vs-code-engineering commented on Jan 30, 2025

    @vs-code-engineering

    Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue.

    Happy Coding!

  4. RedCMD commented on Jan 31, 2025

    @RedCMD

    please put your code in a code block

    ```ts
    code
    ```

    and send a screenshot of the incorrect syntax highlighting

  5. octopols commented on Apr 8, 2025

    @octopols
    Author

    RedCMD (@RedCMD) updated the original comment with the code

    Here is a screenshot of the issue RedCMD (@RedCMD) Osvaldo Ortega (@osortega)

    Image

    It starts working again if I add a new line after line 43

    Image
  6. RedCMD commented on Apr 11, 2025

    @RedCMD

    can confirm
    should move report to https://github.com/microsoft/TypeScript-TmLanguage

    it breaks because of the multi-line typeparameters

    saveOnboardingEvents = ApiHelperV2.using<
        AddBspOnboardingEventRequest,
        AddBspOnboardingEventResponse
      >(async (body) => {

    Image

    Matt Bierner (@mjbvz) would the assumption that smaller than comparisons are not normally split across lines; to be true?
    and thus you can assume that a end of line < starts typeparameters?
    and maybe could prioritize based on whitespace before <
    function-call will need to be modified

    hirnaymay (harsh) (@octopols) workaround
    works as a single line
    Image

  7. RedCMD commented on Apr 12, 2025

    @RedCMD

    easy as adding |(?<!\s)<\s*$ to possiblyMultilineTypeArgument
    Image
    Image

    possiblyMultilineTypeArgument: (<\s*[\{\[\(]\s*$)

  8. mjbvz commented on Apr 14, 2025

    @mjbvz

    Possible duplicate of #1050? I'll leave it open to verify this

  9. octopols commented on Apr 15, 2025

    @octopols
    Author

    can confirm should move report to https://github.com/microsoft/TypeScript-TmLanguage

    it breaks because of the multi-line typeparameters

    saveOnboardingEvents = ApiHelperV2.using<
    AddBspOnboardingEventRequest,
    AddBspOnboardingEventResponse

    (async (body) => {
    Image

    @mjbvz would the assumption that smaller than comparisons are not normally split across lines; to be true? and thus you can assume that a end of line < starts typeparameters? and maybe could prioritize based on whitespace before < function-call will need to be modified

    @octopols workaround works as a single line Image

    Yes I'm already using the workaround

  10. RedCMD commented on Apr 15, 2025

    @RedCMD

    is related
    but not dup
    #1050 is about a false positive
    while this is a false negative

    caused by separate parts of the grammar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions