Skip to content

[BUG] example #20

Description

@tcd

Example Bug Issue

Describe the bug

A line in C# with as followed by ?? breaks highlighting for the rest of the file.

To Reproduce

public partial class SqlServerAdapter : ISqlAdapter
{
    public int Insert(IDbConnection connection, IDbTransaction transaction, int? commandTimeout, string tableName, string columnList, string parameterList, IEnumerable<PropertyInfo> keyProperties, object entityToInsert)
    {
        var cmd = $"insert into {tableName} ({columnList}) values ({parameterList});select SCOPE_IDENTITY() id";
        var multi = connection.QueryMultiple(cmd, entityToInsert, transaction, commandTimeout);

        var first = multi.Read().FirstOrDefault();
        if (first == null || first.id == null) return 0;

        var id = (int)first.id;
        // The following line breaks highlighting
        var propertyInfos = keyProperties as PropertyInfo[] ?? keyProperties.ToArray();
        if (propertyInfos.Length == 0) return id;

        var idProperty = propertyInfos[0];
        idProperty.SetValue(entityToInsert, Convert.ChangeType(id, idProperty.PropertyType), null);

        return id;
    }
}

Screenshots

Screen Shot 2022-02-07 at 11 58 11 AM

Relevant Information

VSCode

  • Track:
    • Insiders
  • Version:
    • 1.65.0-insider
  • Extensions:
    • (this is the output of code --list-extensions | awk '{print " - "$0}' | pbcopy)
    • 42Crunch.vscode-openapi
    • akamud.vscode-theme-onedark
    • alefragnani.Bookmarks
    • alefragnani.project-manager
    • aliariff.vscode-erb-beautify
    • Angular.ng-template
    • Arjun.swagger-viewer
    • bierner.comment-tagged-templates
    • bierner.markdown-checkbox
    • bierner.markdown-mermaid
    • bierner.markdown-preview-github-styles
    • Blodwynn.featurehighlight
    • bpruitt-goddard.mermaid-markdown-syntax-highlighting
    • bung87.vscode-gemfile
    • castwide.solargraph
    • christian-kohler.path-intellisense
    • CraigMaslowski.erb
    • crystal-lang-tools.crystal-lang
    • cstrachan.vcard
    • dbaeumer.vscode-eslint
    • deerawan.vscode-dash
    • devkir.elixir-syntax-vscode
    • DigitalBrainstem.javascript-ejs-support
    • dinhani.divider
    • donjayamanne.githistory
    • dunstontc.dark-plus-syntax
    • dunstontc.viml
    • dunstontc.vscode-angular-syntax
    • dunstontc.vscode-c-syntax
    • dunstontc.vscode-crystal-syntax
    • dunstontc.vscode-docker-syntax
    • dunstontc.vscode-elixir-syntax
    • dunstontc.vscode-gitignore-syntax
    • dunstontc.vscode-go-syntax
    • dunstontc.vscode-rust-syntax
    • dunstontc.vscode-todotxt
    • dustypomerleau.rust-syntax
    • EditorConfig.EditorConfig
    • elmTooling.elm-ls-vscode
    • fabiospampinato.vscode-git-history
    • fabiospampinato.vscode-highlight
    • fbosch.battery-indicator
    • file-icons.file-icons
    • fwcd.kotlin
    • goessner.mdmath
    • golang.go
    • GrapeCity.gc-excelviewer
    • hangxingliu.vscode-nginx-conf-hint
    • hbenl.vscode-test-explorer
    • hjleochen.rails-nav
    • howardzuo.vscode-git-tags
    • IvoBarros.vs-focus
    • James-Yu.latex-workshop
    • janjoerke.align-by-regex
    • jeff-hykin.better-cpp-syntax
    • jemmyw.rails-fast-nav
    • joaompinto.vscode-graphviz
    • justusadam.language-haskell
    • kaiwood.endwise
    • kevinkyang.auto-comment-blocks
    • kisstkondoros.vscode-gutter-preview
    • lamartire.git-indicators
    • luggage66.AWK
    • lukas-tr.materialdesignicons-intellisense
    • marclipovsky.string-manipulation
    • mathiasfrohlich.Kotlin
    • mechatroner.rainbow-csv
    • mhutchie.git-graph
    • MikeBovenlander.formate
    • misogi.ruby-rubocop
    • mrmlnc.vscode-duplicate
    • ms-dotnettools.csharp
    • ms-python.python
    • ms-python.vscode-pylance
    • ms-vscode.test-adapter-converter
    • mxschmitt.postscript
    • naumovs.color-highlight
    • neilding.language-liquid
    • ninoseki.vscode-gem-lens
    • octref.vetur
    • octref.vscode-json-transform
    • oscarcs.dart-syntax-highlighting-only
    • patbenatar.advanced-new-file
    • pomber.git-file-history
    • rebornix.ruby
    • redhat.java
    • redhat.vscode-yaml
    • rid9.datetime
    • Riey.erb
    • RoscoP.ActiveFileInStatusBar
    • salbert.comment-ts
    • samuelcolvin.jinjahtml
    • SarahRidge.vscode-ruby-syntax
    • scala-lang.scala
    • shuworks.vscode-table-formatter
    • sianglim.slim
    • SimonSiefke.svg-preview
    • sissel.shopify-liquid
    • soloham.json-table
    • streetsidesoftware.code-spell-checker
    • syler.sass-indented
    • sysoev.language-stylus
    • tamasfe.even-better-toml
    • tomoki1207.pdf
    • trond-snekvik.simple-rst
    • vayan.haml
    • vscodevim.vim
    • wayou.vscode-todo-highlight
    • will-wow.vscode-alternate-file
    • wilson-freitas.rails-buddy
    • wingrunr21.vscode-ruby
    • wix.vscode-import-cost
    • wscourge.togglecase
    • wwm.better-align
    • xiaoluoboding.vscode-folder-size
    • zh9528.file-size

Activity

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

Metadata

Metadata

Assignees

Labels

bugexampleexample usage of an issue template

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions