microsoft / microsoft/vscode-mssql
[Bug]: Copying SQL text in notebook editor cell causes an exception in console
- Dominant language
- TypeScript
- Stars
- 1.9k
- Forks
- 610
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 97
Description
### Description
When copying a SQL text segment in a notebook cell with Ctrl-C an error is generated in the console log.
```
[Error - 12:22:15 PM] Request textDocument/definition failed.
Message: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
Code: 0
```
### Steps to Reproduce
1. Open SQL Notebook and type some SQL
2. Select the text and type Ctrl-C
Expected: Selected text is copied without error
Actual: An error message is displayed.
Note: This doesn't repro 100% of time, so it seems related to some other state in the cell/notebook.
### Affected Area
- [ ] Connection dialog (SQL Server | Azure browse/Fabric browse)
- [ ] Query editor
- [ ] Query results panel
- [ ] Object Explorer
- [ ] GitHub Copilot integration
- [ ] Preview/Edit data
- [ ] Table Designer
- [ ] Schema Designer
- [ ] Schema Compare
- [ ] Local SQL Server Container provisioning
- [ ] SQL database in Fabric provisioning
- [ ] DACPAC/BACPAC export/import
- [ ] SQL Database projects
- [ ] Query Plan Visualizer
- [ ] Other (please describe below)
### If you selected "Other", please describe the affected area
_No response_
### Environment Information
Latest
### Confirmation
- [x] I have searched existing issues and couldn't find a match
- [ ] I want to work on this issue
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the Ctrl-C action in a SQL Notebook cell and capture the textDocument/definition error shown in the console. Trace the notebook editor and definition-request path involved in copying selected SQL text. Done means copying succeeds without the index-out-of-range exception, including the intermittent state described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql, typescript
- Domain
- databases, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100