Khan / Khan/live-editor

Students make never-ending comments in SQL and don't realize it

Open
#514 6 comments 0 reactions 0 assignees View on GitHub
idea sql
Dominant language
JavaScript
Stars
776
Forks
180
PR merge metrics
No merged PRs in 30d

Description

When going through the newbie syntax reports, I saw several students that had a never-ending comment and couldn't figure out why their code didn't work. We could put a gutter warning or an OhNoes for that - like "It looks like you have SQL code inside a comment. Is that on purpose?"
They could theoretically be planning their SQL in a comment, but if they have no output at all, it's likely a mistake.

Examples:

```
/*** favorite books
nerd camp
pie
dairy of a wimpy kid
fancy nacy
CREATE TABLE FAVORITE BOOKS (ID INTEGER, PRIMARY, KEY NAME, TEXT, QUANTITY,INTEGER );
INSTERT INTO FAVORITE BOOKS VALUES(NEARD CAMP)
INSTERT INTO FAVORITE BOOKS VALUES(PIE)
INSTERT INTO FAVORITE BOOKS VALUES(DAIRY OF A WIMPY KID)
INSTERT INTO FAVORITE BOOKS VALUES(FANCY NACY)
SELECT * FROM FAVORITE BOOKS;
```

```
/** Book List:
The Lost Hero (1)
House Of Hades (1)
**\
CREATE TABLE (id INTEGER PRIMARY KEY,name INTEGER,quantity INTEGER );
/** Book list:
CREATE NAME books(id INTEGER PRIMARY KEY,name TEXT, rating INTEGER);
INSERT INTO favourite books VALUES(1,"Anna Karenina",5);
INSERT INTO favourite books VALUES(2,"Odyssey",4);
SELECT*FROM favourite books
```

```
// malformed comment
**/ book_list
David (1)
Niccollo (2)
Whitey (3)
**/

CREATE TABLE book_list (id INTEGER PRIMARY KEY, title TEXT; rating INTEGER);`
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the live editor's gutter-warning or OhNoes entry points and the SQL comment-detection logic. Reproduce the never-ending comment examples, then define a warning that identifies SQL inside a comment when there is no output while avoiding intentional SQL planning comments.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, sql
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.