export function getStats(database: DBConnection, id: number) {
const query = database.query<[number], Stats>( SELECT * FROM statistics WHERE unit_id = $1 )
return database.execute(query, [id])
}
export function getSessionStats(database: DBConnection, id: number, session :number) {
const query = database.query<[number, number], Stats>( SELECT * FROM statistics WHERE unit_id = $1 AND session = $2 )
return database.execute(query, [id, session])
}
The template strings will not be highlighted properly, and it throws off the highlighting for the rest of the file. Interestingly, the bug only occurs when there is more than one type parameter: remove `Stats` and it formats correctly.
<!-- Launch with `code --disable-extensions` to check. -->
Reproduces without extensions: Yes
Steps to Reproduce:
interface Stats {}
export function getStats(database: DBConnection, id: number) { const query = database.query<[number], Stats>(
SELECT * FROM statistics WHERE unit_id = $1
)}
export function getSessionStats(database: DBConnection, id: number, session :number) { const query = database.query<[number, number], Stats>(
SELECT * FROM statistics WHERE unit_id = $1 AND session = $2
)}