-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Scalar parameter docstring and example arguments unused #479
Changes from all commits
947d3be
d96e515
a3c3691
573a0b6
fc9eeb2
3660229
a47dbd8
5e4eaa6
e9769d0
84f12f5
ce5c360
1959be9
76b990a
2da5447
9e84799
e2e83e7
9fc9afa
41ec976
b4025eb
fc684e3
43bc6f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1695,7 +1695,7 @@ class KustoLanguageService implements LanguageService { | |
const paramSymbol: sym.ScalarSymbol = Kusto.Language.Symbols.ScalarTypes.GetSymbol( | ||
getCslTypeNameFromClrType(param.type) | ||
); | ||
return new sym.ParameterSymbol(param.name, paramSymbol, null); | ||
return new sym.ParameterSymbol(param.name, paramSymbol, param.docstring ?? null); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tested this change, others are a bit more speculative There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not clear on the use case. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Examples and docstring/description are added to tooltips on hover. I'm using them for dashboard system parameters, and and I'd assume other ones are in the system we get from kusto (otherwise, IDK why the C# api would expose it)
Unlike a lot of other stuff, this isn't really load bearing. If it breaks it won't block a release. I don't think it should be a priority for testing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If a unit test would help I might add that, because it would be easy, but I don't think it would do anything useful. An integration tests would be pretty expensive to add. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm sorry if I wasn't clear. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maxburs can you add some examples/screenshots of where this shows up and how? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
|
||
private static createTabularParameterSymbol(param: s.TabularParameter): sym.ParameterSymbol { | ||
|
@@ -1720,13 +1720,13 @@ class KustoLanguageService implements LanguageService { | |
paramSymbol, | ||
null, | ||
null, | ||
null, | ||
param.examples ? KustoLanguageService.toBridgeList(param.examples) : null, | ||
false, | ||
null, | ||
1, | ||
1, | ||
expression, | ||
null | ||
param.docstring ?? null | ||
); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { createMonaKustoModel, MonaKustoModel, loadPageAndWait } from './testkit'; | ||
|
||
test('scalar', async ({ page }) => { | ||
await loadPageAndWait(page); | ||
const model = createMonaKustoModel(page); | ||
|
||
const editor = model.editor().locator; | ||
await editor.focus(); | ||
await editor.fill('print _time_zone'); | ||
|
||
await page.getByRole('code').getByText('_time_zone').hover(); | ||
const tooltip = await page.getByRole('tooltip').locator('.rendered-markdown').innerText(); | ||
expect(tooltip).toEqual( | ||
`_time_zone: string\n\nIANA time zone. For example: "America/Los_Angeles", UTC, or "Europe/Stockholm"` | ||
); | ||
}); | ||
|
||
test('tabular', async ({ page }) => { | ||
await loadPageAndWait(page); | ||
const model = createMonaKustoModel(page); | ||
|
||
const editor = model.editor().locator; | ||
await editor.focus(); | ||
await editor.fill('print _base_query'); | ||
|
||
await page.getByRole('code').getByText('_base_query').hover(); | ||
const tooltip = await page.getByRole('tooltip').locator('.rendered-markdown').innerText(); | ||
expect(tooltip).toEqual( | ||
`_base_query: table(StartTime)\n\nBase query\nAvailability: Inline\n\nBase query will be inlined into this query` | ||
); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where can I see this report?