07:26:03.219 Client { "id": "{279229cb-4cc2-4c4e-98d4-2aa1f823b706}", "jsonrpc": "2.0", "method": "initialize", "params": { "capabilities": { "textDocument": { "codeAction": { "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ "*" ] } } }, "completion": { "completionItem": { "commitCharacterSupport": true, "snippetSupport": true }, "completionItemKind": { "valueSet": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 ] }, "dynamicRegistration": true }, "definition": { "dynamicRegistration": true }, "documentHighlight": { "dynamicRegistration": true }, "documentSymbol": { "hierarchicalDocumentSymbolSupport": true, "symbolKind": { "valueSet": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 ] } }, "formatting": { "dynamicRegistration": true }, "hover": { "contentFormat": [ "markdown", "plaintext" ], "dynamicRegistration": true }, "implementation": { "dynamicRegistration": true }, "onTypeFormatting": { "dynamicRegistration": true }, "rangeFormatting": { "dynamicRegistration": true }, "references": { "dynamicRegistration": true }, "rename": { "dynamicRegistration": true, "prepareSupport": true }, "semanticTokens": { "dynamicRegistration": true, "formats": [ "relative" ], "requests": { "full": { "delta": true } }, "tokenModifiers": [ "declaration", "definition" ], "tokenTypes": [ "type", "class", "enumMember", "typeParameter", "parameter", "variable", "function", "macro", "keyword", "comment", "string", "number", "operator" ] }, "signatureHelp": { "dynamicRegistration": true, "signatureInformation": { "activeParameterSupport": true, "documentationFormat": [ "markdown", "plaintext" ] } }, "synchronization": { "didSave": true, "dynamicRegistration": true, "willSave": true, "willSaveWaitUntil": false }, "typeDefinition": { "dynamicRegistration": true } }, "window": { "workDoneProgress": true }, "workspace": { "applyEdit": true, "configuration": true, "didChangeConfiguration": { "dynamicRegistration": true }, "executeCommand": { "dynamicRegistration": true }, "semanticTokens": { "refreshSupport": true }, "workspaceFolders": true } }, "clientInfo": { "name": "Qt Creator", "version": "9.0.0-beta2" }, "initializationOptions": { }, "processId": 17940, "rootUri": "file:///_/code/rust", "trace": "off", "workspaceFolders": [ { "name": "py", "uri": "file:///_/code/py" }, { "name": "rust", "uri": "file:///_/code/rust" } ] } } 07:26:03.241 Server { "id": "{279229cb-4cc2-4c4e-98d4-2aa1f823b706}", "jsonrpc": "2.0", "result": { "capabilities": { "callHierarchyProvider": true, "codeActionProvider": { "codeActionKinds": [ "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite" ], "resolveProvider": true }, "codeLensProvider": { "resolveProvider": true }, "completionProvider": { "completionItem": { "labelDetailsSupport": false }, "triggerCharacters": [ ":", ".", "'", "(" ] }, "declarationProvider": true, "definitionProvider": true, "documentFormattingProvider": true, "documentHighlightProvider": true, "documentOnTypeFormattingProvider": { "firstTriggerCharacter": "=", "moreTriggerCharacter": [ ".", ">", "{" ] }, "documentRangeFormattingProvider": false, "documentSymbolProvider": true, "experimental": { "externalDocs": true, "hoverRange": true, "joinLines": true, "matchingBrace": true, "moveItem": true, "onEnter": true, "openCargoToml": true, "parentModule": true, "runnables": { "kinds": [ "cargo" ] }, "ssr": true, "workspaceSymbolScopeKindFiltering": true }, "foldingRangeProvider": true, "hoverProvider": true, "implementationProvider": true, "inlayHintProvider": { "resolveProvider": true }, "referencesProvider": true, "renameProvider": { "prepareProvider": true }, "selectionRangeProvider": true, "semanticTokensProvider": { "full": { "delta": true }, "legend": { "tokenModifiers": [ "documentation", "declaration", "static", "defaultLibrary", "async", "attribute", "callable", "constant", "consuming", "controlFlow", "crateRoot", "injected", "intraDocLink", "library", "mutable", "public", "reference", "trait", "unsafe" ], "tokenTypes": [ "comment", "decorator", "enumMember", "enum", "function", "interface", "keyword", "macro", "method", "namespace", "number", "operator", "parameter", "property", "string", "struct", "typeParameter", "variable", "angle", "arithmetic", "attribute", "attributeBracket", "bitwise", "boolean", "brace", "bracket", "builtinAttribute", "builtinType", "character", "colon", "comma", "comparison", "constParameter", "derive", "deriveHelper", "dot", "escapeSequence", "formatSpecifier", "generic", "label", "lifetime", "logical", "macroBang", "parenthesis", "punctuation", "selfKeyword", "selfTypeKeyword", "semicolon", "typeAlias", "toolModule", "union", "unresolvedReference" ] }, "range": true }, "signatureHelpProvider": { "triggerCharacters": [ "(", ",", "<" ] }, "textDocumentSync": { "change": 2, "openClose": true, "save": { } }, "typeDefinitionProvider": true, "workspace": { "fileOperations": { "willRename": { "filters": [ { "pattern": { "glob": "**/*.rs", "matches": "file" }, "scheme": "file" }, { "pattern": { "glob": "**", "matches": "folder" }, "scheme": "file" } ] } } }, "workspaceSymbolProvider": true }, "serverInfo": { "name": "rust-analyzer", "version": "1.65.0 (897e375 2022-11-02)" } } } 07:26:03.241 Client { "jsonrpc": "2.0", "method": "initialized", "params": { } } 07:26:03.242 Client { "jsonrpc": "2.0", "method": "workspace/didChangeConfiguration", "params": { "settings": "" } } 07:26:03.243 Client { "jsonrpc": "2.0", "method": "textDocument/didOpen", "params": { "textDocument": { "languageId": "rust", "text": "#![warn(clippy::all)]\n#![allow(clippy::many_single_char_names)]\n\nuse grafix_toolbox::{gui::*, *};\nuse uses::{asyn::*, math::*, *};\nuse GL::{atlas::*, font::*, mesh::*, pbrt::*, window::*, *};\n\nfn main() {\n\tLOGGER!(logging::Term, INFO);\n\n\tShaderManager::LoadSources(\"shd_pbrt.glsl\");\n\n\tlet mut window = TIMER!(window, {\n\t\tlet win = EXPECT!(Window::get((50, 50, 200, 100), \"Engine\"));\n\t\tGLEnable!(DEPTH_TEST, BLEND, MULTISAMPLE, TEXTURE_CUBE_MAP_SEAMLESS, DEPTH_WRITEMASK);\n\t\tGLDisable!(CULL_FACE);\n\t\tGL::BlendFunc::Set((gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA));\n\t\tGL::DepthFunc::Set(gl::LESS);\n\t\twin\n\t});\n\n\tlet font = {\n\t\tlet alphabet = (9..=9).chain(32_u8..127).map(|n| n as char).collect::() + \"ёйцукенгшщзхъфывапролджэячсмитьбюЁЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ\";\n\t\tFont::new_cached(\"UbuntuMono-R\", alphabet)\n\t};\n\n\tlet mut renderer = Renderer::new(Theme {\n\t\teasing: 10.,\n\t\tbg: (0.2, 0.2, 0.2, 0.7),\n\t\tbg_focus: hex_to_rgba(0x596475A0),\n\t\tfg: hex_to_rgba(0x626975FF),\n\t\tfg_focus: hex_to_rgba(0x461E5CCF),\n\t\thighlight: (0.9, 0.4, 0.1, 1.),\n\t\ttext: (1., 0.9, 0.9, 0.9),\n\t\ttext_focus: (1., 1., 1., 1.),\n\t\ttext_highlight: (0.2, 0.2, 0.2, 1.),\n\t\tfont,\n\t\tfont_size: 0.8,\n\t});\n\n\tlet atlas = TexAtlas::::new();\n\tlet _cat = atlas.load(\"ortodox_grafix.webp\");\n\tlet mut spinner = EXPECT!(Animation::from_file(\"spinner\", &atlas));\n\n\tlet (skybox, brdf_lut) = (EnvTex::from(EXPECT!(Environment::new_cached(\"lythwood_lounge_4k\"))), Environment::lut_cached());\n\n\tlet (mut skybox_shd, mut render_shd) = (\n\t\tEXPECT!(Shader::new((\"vs_skybox\", \"ps_skybox\"))),\n\t\tEXPECT!(Shader::new((\"vs_material_based_render\", \"ps_material_based_render\"))),\n\t);\n\n\tlet (sampl, mipmapped) = (\n\t\t&Sampler::linear(),\n\t\t&Sampler!(\n\t\t\t(TEXTURE_WRAP_R, CLAMP_TO_EDGE),\n\t\t\t(TEXTURE_WRAP_S, CLAMP_TO_EDGE),\n\t\t\t(TEXTURE_WRAP_T, CLAMP_TO_EDGE),\n\t\t\t(TEXTURE_MIN_FILTER, LINEAR_MIPMAP_LINEAR)\n\t\t),\n\t);\n\n\tlet large_text = (0..100)\n\t\t.map(|_| \"Functional textbox is capable of showing millions of lines with negligeble cpu usage!(so long as we're not editing, but that can be solved functionally as well)\\nBiggest issue is collecting the text to display, really - you can set large text range to 1000000 in release.\\n\\nUpper bar allows to drag layout around, pip on the bottom right resizes it.\\n\\n\\n\")\n\t\t.collect::();\n\n\tLayout::storage(ID!(\"menu\")).pos = (-10., -10.);\n\tLayout::storage(ID!(\"menu\")).size = (1.5, 2.);\n\tTextEdit::storage(ID!(\"text\")).text = large_text.into();\n\tSlider::storage(ID!(\"metallicity\")).pip_pos = 0.885;\n\tSlider::storage(ID!(\"roughness\")).pip_pos = 0.286;\n\tSlider::storage(ID!(\"rotation\")).pip_pos = 0.1;\n\n\tlet show_tooltip = |hovered, p: Vec2, msg: &str, r: &mut RenderLock| {\n\t\tif timeout(hovered) {\n\t\t\tlet size = (0.03, 0.1).mul((msg.len(), 1));\n\t\t\tr.clip(p, size);\n\t\t\tr.Label(ID!(\"Tooltip\"), p.sum(size.mul(0.05)), size, msg);\n\t\t\tr.unclip();\n\t\t}\n\t};\n\n\tlet mut exit = false;\n\tlet mut mouse_pos = (0., 0.);\n\tlet mut options = [\"stanford_dragon\", \"dr\", \"tyra\", \"not a model\"].map(String::from);\n\tlet mut demo_mesh = DeferredMesh::default();\n\tlet mut loading_in_progress;\n\tlet mut magnification = 0.3;\n\tlet mut rotation = 0_f32;\n\n\tfor i in (0..100).chain((0..100).step_by(1).rev()).map(|i| f32(i) / 100.).cycle() {\n\t\tlet mut r = renderer.lock();\n\n\t\tlet mut cam1 = Camera::zero((&window, (70, 10)));\n\t\t{\n\t\t\twindow.bind();\n\t\t\twindow.clear((0, 1));\n\n\t\t\tlet metallicity = 0.995 * r.Slider(ID!(\"metallicity\"), (0.3, -0.88), (1., 0.05), 0.05);\n\t\t\tlet roughness = (0.05 + r.Slider(ID!(\"roughness\"), (0.3, -0.94), (1., 0.05), 0.05)) / 1.05;\n\t\t\tr.Label(ID!(\"metal_v\"), (1.31, -0.88), (0.3, 0.05), &format!(\"Metal: {:.3}\", metallicity));\n\t\t\tr.Label(ID!(\"rough_v\"), (1.31, -0.94), (0.3, 0.05), &format!(\"Rough: {:.3}\", roughness));\n\t\t\tlet model_name = Selector::storage(ID!(\"model\")).choice;\n\t\t\tlet model_name = options[model_name].clone();\n\t\t\tr.Selector(ID!(\"model\"), (1.31, -0.82), (0.6, 0.1), &mut options);\n\n\t\t\tlet t = 1. - i;\n\n\t\t\tuse glm::{vec3 as v3, vec4 as v4, Mat4 as m4};\n\t\t\tlet m = magnification;\n\t\t\tlet model = &glm::translate(\n\t\t\t\t&glm::rotate(&glm::scale(&glm::identity(), &v3(m, m, m)), 90_f32.to_radians(), &v3(-1., 0., 0.)),\n\t\t\t\t&v3(0., 0., -0.3),\n\t\t\t);\n\t\t\tlet (c, s, cam_world) = {\n\t\t\t\trotation += r.Slider(ID!(\"rotation\"), (0.3, -1.), (1., 0.05), 0.05) * 0.01;\n\t\t\t\tlet (c, s) = (rotation.cos(), rotation.sin()).mul(0.3);\n\t\t\t\tlet t = t.to_radians() * 90.;\n\t\t\t\t(t.cos(), t.sin(), (s, 0., c))\n\t\t\t};\n\n\t\t\tcam1.setView((cam_world, Vec3::zero(), (0, 1, 0)));\n\t\t\tlet view = m4::to(cam1.V());\n\t\t\tlet (irr, spec, lut) = (skybox.irradiance.Bind(sampl), skybox.specular.Bind(mipmapped), brdf_lut.Bind(sampl));\n\t\t\tlet _ = Uniforms!(\n\t\t\t\trender_shd,\n\t\t\t\t(\"irradiance_cubetex\", &irr),\n\t\t\t\t(\"specular_cubetex\", &spec),\n\t\t\t\t(\"brdf_lut_tex\", &lut),\n\t\t\t\t(\"MVPMat\", cam1.MVP(model)),\n\t\t\t\t(\"ModelViewMat\", cam1.MV(model)),\n\t\t\t\t(\"NormalViewMat\", cam1.NV(model)),\n\t\t\t\t(\"NormalMat\", cam1.N(model)),\n\t\t\t\t(\"iCameraWorld\", Vec3(cam_world)),\n\t\t\t\t(\n\t\t\t\t\t\"iLightPos\",\n\t\t\t\t\t[\n\t\t\t\t\t\tVec4(view * v4(6. * c, 6. * s, 0., 1.)).xyz(),\n\t\t\t\t\t\tVec4(view * v4(2. * c, 0., 2. * s, 1.)).xyz(),\n\t\t\t\t\t\tVec4(view * v4(c, s, -2., 1.)).xyz(),\n\t\t\t\t\t\tVec4(view * v4(-1.5 * s, 1. * c, -2., 1.)).xyz()\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t\t(\"iLightColor\", [(1., 0., 0., 2.), (0., 0., 1., 2.), (1., 0., 1., 2.), (0., 1., 0., 2.)]),\n\t\t\t\t(\"iAlbedo\", hex_to_rgba(0xD4AF3700).xyz()),\n\t\t\t\t(\"iMetallicity\", metallicity),\n\t\t\t\t(\"iRoughness\", roughness),\n\t\t\t\t(\"iExposure\", 1.),\n\t\t\t\t(\"iMaxLod\", skybox.mip_levels)\n\t\t\t);\n\t\t\tloading_in_progress = !demo_mesh.draw(&model_name);\n\t\t}\n\t\t{\n\t\t\tlet s = skybox.specular.Bind(mipmapped);\n\t\t\tlet _ = Uniforms!(skybox_shd, (\"skybox_tex\", &s), (\"MVPMat\", cam1.VP()), (\"iExposure\", 1.));\n\t\t\tSkybox::Draw();\n\t\t}\n\n\t\tr.Layout(ID!(\"menu\"), |r, (pos, size)| {\n\t\t\tlet (button_w, button_h, padding) = (0.18, 0.06, 0.01);\n\t\t\tlet button = |n| (pos.sum(size.mul((button_w * f32(n) + padding * f32(n * 2 + 1), padding))), size.mul((button_w, button_h)));\n\n\t\t\tr.TextEdit(\n\t\t\t\tID!(\"text\"),\n\t\t\t\tpos.sum(size.mul((0, button_h + padding * 2.))),\n\t\t\t\tsize.mul((1, 1. - (button_h + padding * 3.))),\n\t\t\t\t0.05,\n\t\t\t);\n\n\t\t\tlet (p, s) = button(4);\n\t\t\texit = r.Button(ID!(\"exit\"), p, s, \"Exit\");\n\t\t\tshow_tooltip(r.hovers_in((p, p.sum(s))) && !exit, p.sum(s.mul(0.5)), \"GUI is easy!\", r);\n\t\t});\n\n\t\tif loading_in_progress {\n\t\t\tr.draw(primitives::Sprite {\n\t\t\t\tpos: mouse_pos,\n\t\t\t\tsize: (40., 40.).div(window.aspect()).div(window.size()),\n\t\t\t\tcolor: (1., 1. - i, 1., 1.),\n\t\t\t\ttex: spinner.frame(i),\n\t\t\t});\n\t\t}\n\n\t\tlet mut events = window.poll_events();\n\t\tevents.iter().rev().find_map(|e| map_enum!(MouseMove { at, .. } = e => mouse_pos = *at));\n\t\tr.sync_clipboard(&mut window);\n\t\trenderer = r.unlock(&mut window, &mut events);\n\t\twindow.swap();\n\n\t\tfor e in events {\n\t\t\tmatch e {\n\t\t\t\tKeyboard { key, state } if Key::Escape == key && state.pressed() => exit = true,\n\t\t\t\tScroll { at, .. } => {\n\t\t\t\t\tmagnification = (magnification + 0.01 * at.y()).clamp(0.01, 1.);\n\t\t\t\t\trotation += 0.2 * at.x()\n\t\t\t\t}\n\t\t\t\t_ => (), //println!(\"{e:?}\"),\n\t\t\t}\n\t\t}\n\n\t\tif exit {\n\t\t\treturn;\n\t\t}\n\t\tuse events::{Event::*, *};\n\t}\n}\n\nfn timeout(active: bool) -> bool {\n\tunsafe {\n\t\tstatic mut TIME: usize = 0;\n\t\tTIME += 1;\n\t\tif !active {\n\t\t\tTIME = 0\n\t\t}\n\t\tTIME > 60\n\t}\n}\n\n#[derive(Default)]\nstruct DeferredMesh {\n\thandle: Option)>>,\n\tmesh: Option<(String, Box)>,\n}\nimpl DeferredMesh {\n\tfn draw(&mut self, name: &str) -> bool {\n\t\tlet Self { handle, mesh } = self;\n\t\tif let Some((n, m)) = mesh {\n\t\t\tm.Draw();\n\t\t\tif n == name {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif handle.is_none() {\n\t\t\tlet name = name.to_string();\n\t\t\t*mesh = Some((\"\".into(), Box::new(Mesh::make_sphere(0.1, 8))));\n\t\t\t*handle = Some(task::spawn(async move { (name.clone(), Model::new_cached(&name)) }));\n\t\t}\n\n\t\tlet handle = handle.as_mut().valid();\n\t\tlet mut ready = task::block_on(async move { task::poll_once(handle).await });\n\n\t\tif ready.is_some() {\n\t\t\tself.handle = None;\n\t\t\tlet (n, m) = ready.take().valid();\n\t\t\tlet m: Box = m.map_or_else(\n\t\t\t\t|e| {\n\t\t\t\t\tWARN!(\"Failed to load {n:?}, {e}\");\n\t\t\t\t\tMesh::make_sphere(0.1, 8).to_trait()\n\t\t\t\t},\n\t\t\t\t|m| Mesh::from(m).to_trait(),\n\t\t\t);\n\t\t\t*mesh = Some((n, m));\n\t\t}\n\t\tfalse\n\t}\n}\n", "uri": "file:///_/code/rust/frontier/main.rs", "version": 0 } } } 07:26:03.243 Client { "id": "{e8e583ce-839b-4e67-9edc-410cdc58bb48}", "jsonrpc": "2.0", "method": "textDocument/semanticTokens/full", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:03.253 Server { "id": 0, "jsonrpc": "2.0", "method": "client/registerCapability", "params": { "registrations": [ { "id": "textDocument/didSave", "method": "textDocument/didSave", "registerOptions": { "documentSelector": [ { "pattern": "**/*.rs" }, { "pattern": "**/Cargo.toml" }, { "pattern": "**/Cargo.lock" } ], "includeText": false } } ] } } 07:26:03.253 Client { "id": 0, "jsonrpc": "2.0", "result": null } 07:26:03.254 Server { "id": 1, "jsonrpc": "2.0", "method": "workspace/configuration", "params": { "items": [ { "section": "rust-analyzer" } ] } } 07:26:03.254 Client { "error": { "code": -32601 }, "id": 1, "jsonrpc": "2.0" } 07:26:03.254 Server { "id": 2, "jsonrpc": "2.0", "method": "window/workDoneProgress/create", "params": { "token": "rustAnalyzer/Fetching" } } 07:26:03.254 Client { "id": 2, "jsonrpc": "2.0", "result": null } 07:26:03.254 Server { "jsonrpc": "2.0", "method": "$/progress", "params": { "token": "rustAnalyzer/Fetching", "value": { "kind": "begin", "title": "Fetching" } } } 07:26:03.254 Server { "error": { "code": -32801, "message": "waiting for cargo metadata or cargo check" }, "id": "{e8e583ce-839b-4e67-9edc-410cdc58bb48}", "jsonrpc": "2.0" } 07:26:03.254 Client { "id": "{cc009f2f-8a1f-4e46-a585-ca24699877ee}", "jsonrpc": "2.0", "method": "textDocument/semanticTokens/full", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:03.254 Client { "jsonrpc": "2.0", "method": "$/cancelRequest", "params": { "id": "{cc009f2f-8a1f-4e46-a585-ca24699877ee}" } } 07:26:03.254 Client { "id": "{41412e3c-e9a3-4831-93d2-b1f2ff348af5}", "jsonrpc": "2.0", "method": "textDocument/semanticTokens/full", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:03.435 Client { "id": "{2f7b04f9-6879-4132-9b67-cc13463c8f29}", "jsonrpc": "2.0", "method": "textDocument/documentSymbol", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:03.508 Client { "id": "{0fa1b601-7469-4da3-bbbd-cbf0d5f46e9b}", "jsonrpc": "2.0", "method": "textDocument/documentHighlight", "params": { "position": { "character": 37, "line": 97 }, "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:08.533 Client { "id": "{291b2351-c267-4235-bab8-7d3871167a6c}", "jsonrpc": "2.0", "method": "initialize", "params": { "capabilities": { "textDocument": { "codeAction": { "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ "*" ] } } }, "completion": { "completionItem": { "commitCharacterSupport": true, "snippetSupport": true }, "completionItemKind": { "valueSet": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 ] }, "dynamicRegistration": true }, "definition": { "dynamicRegistration": true }, "documentHighlight": { "dynamicRegistration": true }, "documentSymbol": { "hierarchicalDocumentSymbolSupport": true, "symbolKind": { "valueSet": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 ] } }, "formatting": { "dynamicRegistration": true }, "hover": { "contentFormat": [ "markdown", "plaintext" ], "dynamicRegistration": true }, "implementation": { "dynamicRegistration": true }, "onTypeFormatting": { "dynamicRegistration": true }, "rangeFormatting": { "dynamicRegistration": true }, "references": { "dynamicRegistration": true }, "rename": { "dynamicRegistration": true, "prepareSupport": true }, "semanticTokens": { "dynamicRegistration": true, "formats": [ "relative" ], "requests": { "full": { "delta": true } }, "tokenModifiers": [ "declaration", "definition" ], "tokenTypes": [ "type", "class", "enumMember", "typeParameter", "parameter", "variable", "function", "macro", "keyword", "comment", "string", "number", "operator" ] }, "signatureHelp": { "dynamicRegistration": true, "signatureInformation": { "activeParameterSupport": true, "documentationFormat": [ "markdown", "plaintext" ] } }, "synchronization": { "didSave": true, "dynamicRegistration": true, "willSave": true, "willSaveWaitUntil": false }, "typeDefinition": { "dynamicRegistration": true } }, "window": { "workDoneProgress": true }, "workspace": { "applyEdit": true, "configuration": true, "didChangeConfiguration": { "dynamicRegistration": true }, "executeCommand": { "dynamicRegistration": true }, "semanticTokens": { "refreshSupport": true }, "workspaceFolders": true } }, "clientInfo": { "name": "Qt Creator", "version": "9.0.0-beta2" }, "initializationOptions": { }, "processId": 17940, "rootUri": "file:///_/code/rust", "trace": "off", "workspaceFolders": [ { "name": "py", "uri": "file:///_/code/py" }, { "name": "rust", "uri": "file:///_/code/rust" } ] } } 07:26:08.538 Server { "id": "{291b2351-c267-4235-bab8-7d3871167a6c}", "jsonrpc": "2.0", "result": { "capabilities": { "callHierarchyProvider": true, "codeActionProvider": { "codeActionKinds": [ "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite" ], "resolveProvider": true }, "codeLensProvider": { "resolveProvider": true }, "completionProvider": { "completionItem": { "labelDetailsSupport": false }, "triggerCharacters": [ ":", ".", "'", "(" ] }, "declarationProvider": true, "definitionProvider": true, "documentFormattingProvider": true, "documentHighlightProvider": true, "documentOnTypeFormattingProvider": { "firstTriggerCharacter": "=", "moreTriggerCharacter": [ ".", ">", "{" ] }, "documentRangeFormattingProvider": false, "documentSymbolProvider": true, "experimental": { "externalDocs": true, "hoverRange": true, "joinLines": true, "matchingBrace": true, "moveItem": true, "onEnter": true, "openCargoToml": true, "parentModule": true, "runnables": { "kinds": [ "cargo" ] }, "ssr": true, "workspaceSymbolScopeKindFiltering": true }, "foldingRangeProvider": true, "hoverProvider": true, "implementationProvider": true, "inlayHintProvider": { "resolveProvider": true }, "referencesProvider": true, "renameProvider": { "prepareProvider": true }, "selectionRangeProvider": true, "semanticTokensProvider": { "full": { "delta": true }, "legend": { "tokenModifiers": [ "documentation", "declaration", "static", "defaultLibrary", "async", "attribute", "callable", "constant", "consuming", "controlFlow", "crateRoot", "injected", "intraDocLink", "library", "mutable", "public", "reference", "trait", "unsafe" ], "tokenTypes": [ "comment", "decorator", "enumMember", "enum", "function", "interface", "keyword", "macro", "method", "namespace", "number", "operator", "parameter", "property", "string", "struct", "typeParameter", "variable", "angle", "arithmetic", "attribute", "attributeBracket", "bitwise", "boolean", "brace", "bracket", "builtinAttribute", "builtinType", "character", "colon", "comma", "comparison", "constParameter", "derive", "deriveHelper", "dot", "escapeSequence", "formatSpecifier", "generic", "label", "lifetime", "logical", "macroBang", "parenthesis", "punctuation", "selfKeyword", "selfTypeKeyword", "semicolon", "typeAlias", "toolModule", "union", "unresolvedReference" ] }, "range": true }, "signatureHelpProvider": { "triggerCharacters": [ "(", ",", "<" ] }, "textDocumentSync": { "change": 2, "openClose": true, "save": { } }, "typeDefinitionProvider": true, "workspace": { "fileOperations": { "willRename": { "filters": [ { "pattern": { "glob": "**/*.rs", "matches": "file" }, "scheme": "file" }, { "pattern": { "glob": "**", "matches": "folder" }, "scheme": "file" } ] } } }, "workspaceSymbolProvider": true }, "serverInfo": { "name": "rust-analyzer", "version": "1.65.0 (897e375 2022-11-02)" } } } 07:26:08.538 Client { "jsonrpc": "2.0", "method": "initialized", "params": { } } 07:26:08.538 Client { "jsonrpc": "2.0", "method": "workspace/didChangeConfiguration", "params": { "settings": "" } } 07:26:08.540 Client { "jsonrpc": "2.0", "method": "textDocument/didOpen", "params": { "textDocument": { "languageId": "rust", "text": "#![warn(clippy::all)]\n#![allow(clippy::many_single_char_names)]\n\nuse grafix_toolbox::{gui::*, *};\nuse uses::{asyn::*, math::*, *};\nuse GL::{atlas::*, font::*, mesh::*, pbrt::*, window::*, *};\n\nfn main() {\n\tLOGGER!(logging::Term, INFO);\n\n\tShaderManager::LoadSources(\"shd_pbrt.glsl\");\n\n\tlet mut window = TIMER!(window, {\n\t\tlet win = EXPECT!(Window::get((50, 50, 200, 100), \"Engine\"));\n\t\tGLEnable!(DEPTH_TEST, BLEND, MULTISAMPLE, TEXTURE_CUBE_MAP_SEAMLESS, DEPTH_WRITEMASK);\n\t\tGLDisable!(CULL_FACE);\n\t\tGL::BlendFunc::Set((gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA));\n\t\tGL::DepthFunc::Set(gl::LESS);\n\t\twin\n\t});\n\n\tlet font = {\n\t\tlet alphabet = (9..=9).chain(32_u8..127).map(|n| n as char).collect::() + \"ёйцукенгшщзхъфывапролджэячсмитьбюЁЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ\";\n\t\tFont::new_cached(\"UbuntuMono-R\", alphabet)\n\t};\n\n\tlet mut renderer = Renderer::new(Theme {\n\t\teasing: 10.,\n\t\tbg: (0.2, 0.2, 0.2, 0.7),\n\t\tbg_focus: hex_to_rgba(0x596475A0),\n\t\tfg: hex_to_rgba(0x626975FF),\n\t\tfg_focus: hex_to_rgba(0x461E5CCF),\n\t\thighlight: (0.9, 0.4, 0.1, 1.),\n\t\ttext: (1., 0.9, 0.9, 0.9),\n\t\ttext_focus: (1., 1., 1., 1.),\n\t\ttext_highlight: (0.2, 0.2, 0.2, 1.),\n\t\tfont,\n\t\tfont_size: 0.8,\n\t});\n\n\tlet atlas = TexAtlas::::new();\n\tlet _cat = atlas.load(\"ortodox_grafix.webp\");\n\tlet mut spinner = EXPECT!(Animation::from_file(\"spinner\", &atlas));\n\n\tlet (skybox, brdf_lut) = (EnvTex::from(EXPECT!(Environment::new_cached(\"lythwood_lounge_4k\"))), Environment::lut_cached());\n\n\tlet (mut skybox_shd, mut render_shd) = (\n\t\tEXPECT!(Shader::new((\"vs_skybox\", \"ps_skybox\"))),\n\t\tEXPECT!(Shader::new((\"vs_material_based_render\", \"ps_material_based_render\"))),\n\t);\n\n\tlet (sampl, mipmapped) = (\n\t\t&Sampler::linear(),\n\t\t&Sampler!(\n\t\t\t(TEXTURE_WRAP_R, CLAMP_TO_EDGE),\n\t\t\t(TEXTURE_WRAP_S, CLAMP_TO_EDGE),\n\t\t\t(TEXTURE_WRAP_T, CLAMP_TO_EDGE),\n\t\t\t(TEXTURE_MIN_FILTER, LINEAR_MIPMAP_LINEAR)\n\t\t),\n\t);\n\n\tlet large_text = (0..100)\n\t\t.map(|_| \"Functional textbox is capable of showing millions of lines with negligeble cpu usage!(so long as we're not editing, but that can be solved functionally as well)\\nBiggest issue is collecting the text to display, really - you can set large text range to 1000000 in release.\\n\\nUpper bar allows to drag layout around, pip on the bottom right resizes it.\\n\\n\\n\")\n\t\t.collect::();\n\n\tLayout::storage(ID!(\"menu\")).pos = (-10., -10.);\n\tLayout::storage(ID!(\"menu\")).size = (1.5, 2.);\n\tTextEdit::storage(ID!(\"text\")).text = large_text.into();\n\tSlider::storage(ID!(\"metallicity\")).pip_pos = 0.885;\n\tSlider::storage(ID!(\"roughness\")).pip_pos = 0.286;\n\tSlider::storage(ID!(\"rotation\")).pip_pos = 0.1;\n\n\tlet show_tooltip = |hovered, p: Vec2, msg: &str, r: &mut RenderLock| {\n\t\tif timeout(hovered) {\n\t\t\tlet size = (0.03, 0.1).mul((msg.len(), 1));\n\t\t\tr.clip(p, size);\n\t\t\tr.Label(ID!(\"Tooltip\"), p.sum(size.mul(0.05)), size, msg);\n\t\t\tr.unclip();\n\t\t}\n\t};\n\n\tlet mut exit = false;\n\tlet mut mouse_pos = (0., 0.);\n\tlet mut options = [\"stanford_dragon\", \"dr\", \"tyra\", \"not a model\"].map(String::from);\n\tlet mut demo_mesh = DeferredMesh::default();\n\tlet mut loading_in_progress;\n\tlet mut magnification = 0.3;\n\tlet mut rotation = 0_f32;\n\n\tfor i in (0..100).chain((0..100).step_by(1).rev()).map(|i| f32(i) / 100.).cycle() {\n\t\tlet mut r = renderer.lock();\n\n\t\tlet mut cam1 = Camera::zero((&window, (70, 10)));\n\t\t{\n\t\t\twindow.bind();\n\t\t\twindow.clear((0, 1));\n\n\t\t\tlet metallicity = 0.995 * r.Slider(ID!(\"metallicity\"), (0.3, -0.88), (1., 0.05), 0.05);\n\t\t\tlet roughness = (0.05 + r.Slider(ID!(\"roughness\"), (0.3, -0.94), (1., 0.05), 0.05)) / 1.05;\n\t\t\tr.Label(ID!(\"metal_v\"), (1.31, -0.88), (0.3, 0.05), &format!(\"Metal: {:.3}\", metallicity));\n\t\t\tr.Label(ID!(\"rough_v\"), (1.31, -0.94), (0.3, 0.05), &format!(\"Rough: {:.3}\", roughness));\n\t\t\tlet model_name = Selector::storage(ID!(\"model\")).choice;\n\t\t\tlet model_name = options[model_name].clone();\n\t\t\tr.Selector(ID!(\"model\"), (1.31, -0.82), (0.6, 0.1), &mut options);\n\n\t\t\tlet t = 1. - i;\n\n\t\t\tuse glm::{vec3 as v3, vec4 as v4, Mat4 as m4};\n\t\t\tlet m = magnification;\n\t\t\tlet model = &glm::translate(\n\t\t\t\t&glm::rotate(&glm::scale(&glm::identity(), &v3(m, m, m)), 90_f32.to_radians(), &v3(-1., 0., 0.)),\n\t\t\t\t&v3(0., 0., -0.3),\n\t\t\t);\n\t\t\tlet (c, s, cam_world) = {\n\t\t\t\trotation += r.Slider(ID!(\"rotation\"), (0.3, -1.), (1., 0.05), 0.05) * 0.01;\n\t\t\t\tlet (c, s) = (rotation.cos(), rotation.sin()).mul(0.3);\n\t\t\t\tlet t = t.to_radians() * 90.;\n\t\t\t\t(t.cos(), t.sin(), (s, 0., c))\n\t\t\t};\n\n\t\t\tcam1.setView((cam_world, Vec3::zero(), (0, 1, 0)));\n\t\t\tlet view = m4::to(cam1.V());\n\t\t\tlet (irr, spec, lut) = (skybox.irradiance.Bind(sampl), skybox.specular.Bind(mipmapped), brdf_lut.Bind(sampl));\n\t\t\tlet _ = Uniforms!(\n\t\t\t\trender_shd,\n\t\t\t\t(\"irradiance_cubetex\", &irr),\n\t\t\t\t(\"specular_cubetex\", &spec),\n\t\t\t\t(\"brdf_lut_tex\", &lut),\n\t\t\t\t(\"MVPMat\", cam1.MVP(model)),\n\t\t\t\t(\"ModelViewMat\", cam1.MV(model)),\n\t\t\t\t(\"NormalViewMat\", cam1.NV(model)),\n\t\t\t\t(\"NormalMat\", cam1.N(model)),\n\t\t\t\t(\"iCameraWorld\", Vec3(cam_world)),\n\t\t\t\t(\n\t\t\t\t\t\"iLightPos\",\n\t\t\t\t\t[\n\t\t\t\t\t\tVec4(view * v4(6. * c, 6. * s, 0., 1.)).xyz(),\n\t\t\t\t\t\tVec4(view * v4(2. * c, 0., 2. * s, 1.)).xyz(),\n\t\t\t\t\t\tVec4(view * v4(c, s, -2., 1.)).xyz(),\n\t\t\t\t\t\tVec4(view * v4(-1.5 * s, 1. * c, -2., 1.)).xyz()\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t\t(\"iLightColor\", [(1., 0., 0., 2.), (0., 0., 1., 2.), (1., 0., 1., 2.), (0., 1., 0., 2.)]),\n\t\t\t\t(\"iAlbedo\", hex_to_rgba(0xD4AF3700).xyz()),\n\t\t\t\t(\"iMetallicity\", metallicity),\n\t\t\t\t(\"iRoughness\", roughness),\n\t\t\t\t(\"iExposure\", 1.),\n\t\t\t\t(\"iMaxLod\", skybox.mip_levels)\n\t\t\t);\n\t\t\tloading_in_progress = !demo_mesh.draw(&model_name);\n\t\t}\n\t\t{\n\t\t\tlet s = skybox.specular.Bind(mipmapped);\n\t\t\tlet _ = Uniforms!(skybox_shd, (\"skybox_tex\", &s), (\"MVPMat\", cam1.VP()), (\"iExposure\", 1.));\n\t\t\tSkybox::Draw();\n\t\t}\n\n\t\tr.Layout(ID!(\"menu\"), |r, (pos, size)| {\n\t\t\tlet (button_w, button_h, padding) = (0.18, 0.06, 0.01);\n\t\t\tlet button = |n| (pos.sum(size.mul((button_w * f32(n) + padding * f32(n * 2 + 1), padding))), size.mul((button_w, button_h)));\n\n\t\t\tr.TextEdit(\n\t\t\t\tID!(\"text\"),\n\t\t\t\tpos.sum(size.mul((0, button_h + padding * 2.))),\n\t\t\t\tsize.mul((1, 1. - (button_h + padding * 3.))),\n\t\t\t\t0.05,\n\t\t\t);\n\n\t\t\tlet (p, s) = button(4);\n\t\t\texit = r.Button(ID!(\"exit\"), p, s, \"Exit\");\n\t\t\tshow_tooltip(r.hovers_in((p, p.sum(s))) && !exit, p.sum(s.mul(0.5)), \"GUI is easy!\", r);\n\t\t});\n\n\t\tif loading_in_progress {\n\t\t\tr.draw(primitives::Sprite {\n\t\t\t\tpos: mouse_pos,\n\t\t\t\tsize: (40., 40.).div(window.aspect()).div(window.size()),\n\t\t\t\tcolor: (1., 1. - i, 1., 1.),\n\t\t\t\ttex: spinner.frame(i),\n\t\t\t});\n\t\t}\n\n\t\tlet mut events = window.poll_events();\n\t\tevents.iter().rev().find_map(|e| map_enum!(MouseMove { at, .. } = e => mouse_pos = *at));\n\t\tr.sync_clipboard(&mut window);\n\t\trenderer = r.unlock(&mut window, &mut events);\n\t\twindow.swap();\n\n\t\tfor e in events {\n\t\t\tmatch e {\n\t\t\t\tKeyboard { key, state } if Key::Escape == key && state.pressed() => exit = true,\n\t\t\t\tScroll { at, .. } => {\n\t\t\t\t\tmagnification = (magnification + 0.01 * at.y()).clamp(0.01, 1.);\n\t\t\t\t\trotation += 0.2 * at.x()\n\t\t\t\t}\n\t\t\t\t_ => (), //println!(\"{e:?}\"),\n\t\t\t}\n\t\t}\n\n\t\tif exit {\n\t\t\treturn;\n\t\t}\n\t\tuse events::{Event::*, *};\n\t}\n}\n\nfn timeout(active: bool) -> bool {\n\tunsafe {\n\t\tstatic mut TIME: usize = 0;\n\t\tTIME += 1;\n\t\tif !active {\n\t\t\tTIME = 0\n\t\t}\n\t\tTIME > 60\n\t}\n}\n\n#[derive(Default)]\nstruct DeferredMesh {\n\thandle: Option)>>,\n\tmesh: Option<(String, Box)>,\n}\nimpl DeferredMesh {\n\tfn draw(&mut self, name: &str) -> bool {\n\t\tlet Self { handle, mesh } = self;\n\t\tif let Some((n, m)) = mesh {\n\t\t\tm.Draw();\n\t\t\tif n == name {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif handle.is_none() {\n\t\t\tlet name = name.to_string();\n\t\t\t*mesh = Some((\"\".into(), Box::new(Mesh::make_sphere(0.1, 8))));\n\t\t\t*handle = Some(task::spawn(async move { (name.clone(), Model::new_cached(&name)) }));\n\t\t}\n\n\t\tlet handle = handle.as_mut().valid();\n\t\tlet mut ready = task::block_on(async move { task::poll_once(handle).await });\n\n\t\tif ready.is_some() {\n\t\t\tself.handle = None;\n\t\t\tlet (n, m) = ready.take().valid();\n\t\t\tlet m: Box = m.map_or_else(\n\t\t\t\t|e| {\n\t\t\t\t\tWARN!(\"Failed to load {n:?}, {e}\");\n\t\t\t\t\tMesh::make_sphere(0.1, 8).to_trait()\n\t\t\t\t},\n\t\t\t\t|m| Mesh::from(m).to_trait(),\n\t\t\t);\n\t\t\t*mesh = Some((n, m));\n\t\t}\n\t\tfalse\n\t}\n}\n", "uri": "file:///_/code/rust/frontier/main.rs", "version": 0 } } } 07:26:08.540 Client { "jsonrpc": "2.0", "method": "$/cancelRequest", "params": { "id": "{41412e3c-e9a3-4831-93d2-b1f2ff348af5}" } } 07:26:08.540 Client { "id": "{366d4e62-1f9b-4dba-9219-1c9ce8a79c5f}", "jsonrpc": "2.0", "method": "textDocument/semanticTokens/full", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:08.542 Client { "jsonrpc": "2.0", "method": "$/cancelRequest", "params": { "id": "{0fa1b601-7469-4da3-bbbd-cbf0d5f46e9b}" } } 07:26:08.542 Server { "id": 0, "jsonrpc": "2.0", "method": "client/registerCapability", "params": { "registrations": [ { "id": "textDocument/didSave", "method": "textDocument/didSave", "registerOptions": { "documentSelector": [ { "pattern": "**/*.rs" }, { "pattern": "**/Cargo.toml" }, { "pattern": "**/Cargo.lock" } ], "includeText": false } } ] } } 07:26:08.542 Client { "id": 0, "jsonrpc": "2.0", "result": null } 07:26:08.542 Server { "id": 1, "jsonrpc": "2.0", "method": "workspace/configuration", "params": { "items": [ { "section": "rust-analyzer" } ] } } 07:26:08.542 Client { "error": { "code": -32601 }, "id": 1, "jsonrpc": "2.0" } 07:26:08.542 Server { "id": 2, "jsonrpc": "2.0", "method": "window/workDoneProgress/create", "params": { "token": "rustAnalyzer/Fetching" } } 07:26:08.542 Client { "id": 2, "jsonrpc": "2.0", "result": null } 07:26:08.542 Server { "jsonrpc": "2.0", "method": "$/progress", "params": { "token": "rustAnalyzer/Fetching", "value": { "kind": "begin", "title": "Fetching" } } } 07:26:08.543 Server { "error": { "code": -32801, "message": "waiting for cargo metadata or cargo check" }, "id": "{366d4e62-1f9b-4dba-9219-1c9ce8a79c5f}", "jsonrpc": "2.0" } 07:26:08.543 Client { "id": "{0248336d-cb8d-4da5-b17d-6ad57c3b6bd7}", "jsonrpc": "2.0", "method": "textDocument/semanticTokens/full", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:08.543 Client { "jsonrpc": "2.0", "method": "$/cancelRequest", "params": { "id": "{0248336d-cb8d-4da5-b17d-6ad57c3b6bd7}" } } 07:26:08.543 Client { "id": "{ce7bd50c-1685-4dd8-8a1e-ede854494501}", "jsonrpc": "2.0", "method": "textDocument/semanticTokens/full", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:08.747 Client { "id": "{bd4edfae-0cb5-4630-b08d-89940ac63c23}", "jsonrpc": "2.0", "method": "textDocument/documentSymbol", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:08.805 Client { "id": "{82f29cb1-2f01-4866-a6b3-ec14f61c6f4c}", "jsonrpc": "2.0", "method": "textDocument/documentHighlight", "params": { "position": { "character": 37, "line": 97 }, "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:14.350 Client { "id": "{646336f1-e13c-4c3a-a174-77257197062e}", "jsonrpc": "2.0", "method": "initialize", "params": { "capabilities": { "textDocument": { "codeAction": { "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ "*" ] } } }, "completion": { "completionItem": { "commitCharacterSupport": true, "snippetSupport": true }, "completionItemKind": { "valueSet": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 ] }, "dynamicRegistration": true }, "definition": { "dynamicRegistration": true }, "documentHighlight": { "dynamicRegistration": true }, "documentSymbol": { "hierarchicalDocumentSymbolSupport": true, "symbolKind": { "valueSet": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 ] } }, "formatting": { "dynamicRegistration": true }, "hover": { "contentFormat": [ "markdown", "plaintext" ], "dynamicRegistration": true }, "implementation": { "dynamicRegistration": true }, "onTypeFormatting": { "dynamicRegistration": true }, "rangeFormatting": { "dynamicRegistration": true }, "references": { "dynamicRegistration": true }, "rename": { "dynamicRegistration": true, "prepareSupport": true }, "semanticTokens": { "dynamicRegistration": true, "formats": [ "relative" ], "requests": { "full": { "delta": true } }, "tokenModifiers": [ "declaration", "definition" ], "tokenTypes": [ "type", "class", "enumMember", "typeParameter", "parameter", "variable", "function", "macro", "keyword", "comment", "string", "number", "operator" ] }, "signatureHelp": { "dynamicRegistration": true, "signatureInformation": { "activeParameterSupport": true, "documentationFormat": [ "markdown", "plaintext" ] } }, "synchronization": { "didSave": true, "dynamicRegistration": true, "willSave": true, "willSaveWaitUntil": false }, "typeDefinition": { "dynamicRegistration": true } }, "window": { "workDoneProgress": true }, "workspace": { "applyEdit": true, "configuration": true, "didChangeConfiguration": { "dynamicRegistration": true }, "executeCommand": { "dynamicRegistration": true }, "semanticTokens": { "refreshSupport": true }, "workspaceFolders": true } }, "clientInfo": { "name": "Qt Creator", "version": "9.0.0-beta2" }, "initializationOptions": { }, "processId": 17940, "rootUri": "file:///_/code/rust", "trace": "off", "workspaceFolders": [ { "name": "py", "uri": "file:///_/code/py" }, { "name": "rust", "uri": "file:///_/code/rust" } ] } } 07:26:14.355 Server { "id": "{646336f1-e13c-4c3a-a174-77257197062e}", "jsonrpc": "2.0", "result": { "capabilities": { "callHierarchyProvider": true, "codeActionProvider": { "codeActionKinds": [ "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite" ], "resolveProvider": true }, "codeLensProvider": { "resolveProvider": true }, "completionProvider": { "completionItem": { "labelDetailsSupport": false }, "triggerCharacters": [ ":", ".", "'", "(" ] }, "declarationProvider": true, "definitionProvider": true, "documentFormattingProvider": true, "documentHighlightProvider": true, "documentOnTypeFormattingProvider": { "firstTriggerCharacter": "=", "moreTriggerCharacter": [ ".", ">", "{" ] }, "documentRangeFormattingProvider": false, "documentSymbolProvider": true, "experimental": { "externalDocs": true, "hoverRange": true, "joinLines": true, "matchingBrace": true, "moveItem": true, "onEnter": true, "openCargoToml": true, "parentModule": true, "runnables": { "kinds": [ "cargo" ] }, "ssr": true, "workspaceSymbolScopeKindFiltering": true }, "foldingRangeProvider": true, "hoverProvider": true, "implementationProvider": true, "inlayHintProvider": { "resolveProvider": true }, "referencesProvider": true, "renameProvider": { "prepareProvider": true }, "selectionRangeProvider": true, "semanticTokensProvider": { "full": { "delta": true }, "legend": { "tokenModifiers": [ "documentation", "declaration", "static", "defaultLibrary", "async", "attribute", "callable", "constant", "consuming", "controlFlow", "crateRoot", "injected", "intraDocLink", "library", "mutable", "public", "reference", "trait", "unsafe" ], "tokenTypes": [ "comment", "decorator", "enumMember", "enum", "function", "interface", "keyword", "macro", "method", "namespace", "number", "operator", "parameter", "property", "string", "struct", "typeParameter", "variable", "angle", "arithmetic", "attribute", "attributeBracket", "bitwise", "boolean", "brace", "bracket", "builtinAttribute", "builtinType", "character", "colon", "comma", "comparison", "constParameter", "derive", "deriveHelper", "dot", "escapeSequence", "formatSpecifier", "generic", "label", "lifetime", "logical", "macroBang", "parenthesis", "punctuation", "selfKeyword", "selfTypeKeyword", "semicolon", "typeAlias", "toolModule", "union", "unresolvedReference" ] }, "range": true }, "signatureHelpProvider": { "triggerCharacters": [ "(", ",", "<" ] }, "textDocumentSync": { "change": 2, "openClose": true, "save": { } }, "typeDefinitionProvider": true, "workspace": { "fileOperations": { "willRename": { "filters": [ { "pattern": { "glob": "**/*.rs", "matches": "file" }, "scheme": "file" }, { "pattern": { "glob": "**", "matches": "folder" }, "scheme": "file" } ] } } }, "workspaceSymbolProvider": true }, "serverInfo": { "name": "rust-analyzer", "version": "1.65.0 (897e375 2022-11-02)" } } } 07:26:14.355 Client { "jsonrpc": "2.0", "method": "initialized", "params": { } } 07:26:14.355 Client { "jsonrpc": "2.0", "method": "workspace/didChangeConfiguration", "params": { "settings": "" } } 07:26:14.356 Client { "jsonrpc": "2.0", "method": "textDocument/didOpen", "params": { "textDocument": { "languageId": "rust", "text": "#![warn(clippy::all)]\n#![allow(clippy::many_single_char_names)]\n\nuse grafix_toolbox::{gui::*, *};\nuse uses::{asyn::*, math::*, *};\nuse GL::{atlas::*, font::*, mesh::*, pbrt::*, window::*, *};\n\nfn main() {\n\tLOGGER!(logging::Term, INFO);\n\n\tShaderManager::LoadSources(\"shd_pbrt.glsl\");\n\n\tlet mut window = TIMER!(window, {\n\t\tlet win = EXPECT!(Window::get((50, 50, 200, 100), \"Engine\"));\n\t\tGLEnable!(DEPTH_TEST, BLEND, MULTISAMPLE, TEXTURE_CUBE_MAP_SEAMLESS, DEPTH_WRITEMASK);\n\t\tGLDisable!(CULL_FACE);\n\t\tGL::BlendFunc::Set((gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA));\n\t\tGL::DepthFunc::Set(gl::LESS);\n\t\twin\n\t});\n\n\tlet font = {\n\t\tlet alphabet = (9..=9).chain(32_u8..127).map(|n| n as char).collect::() + \"ёйцукенгшщзхъфывапролджэячсмитьбюЁЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ\";\n\t\tFont::new_cached(\"UbuntuMono-R\", alphabet)\n\t};\n\n\tlet mut renderer = Renderer::new(Theme {\n\t\teasing: 10.,\n\t\tbg: (0.2, 0.2, 0.2, 0.7),\n\t\tbg_focus: hex_to_rgba(0x596475A0),\n\t\tfg: hex_to_rgba(0x626975FF),\n\t\tfg_focus: hex_to_rgba(0x461E5CCF),\n\t\thighlight: (0.9, 0.4, 0.1, 1.),\n\t\ttext: (1., 0.9, 0.9, 0.9),\n\t\ttext_focus: (1., 1., 1., 1.),\n\t\ttext_highlight: (0.2, 0.2, 0.2, 1.),\n\t\tfont,\n\t\tfont_size: 0.8,\n\t});\n\n\tlet atlas = TexAtlas::::new();\n\tlet _cat = atlas.load(\"ortodox_grafix.webp\");\n\tlet mut spinner = EXPECT!(Animation::from_file(\"spinner\", &atlas));\n\n\tlet (skybox, brdf_lut) = (EnvTex::from(EXPECT!(Environment::new_cached(\"lythwood_lounge_4k\"))), Environment::lut_cached());\n\n\tlet (mut skybox_shd, mut render_shd) = (\n\t\tEXPECT!(Shader::new((\"vs_skybox\", \"ps_skybox\"))),\n\t\tEXPECT!(Shader::new((\"vs_material_based_render\", \"ps_material_based_render\"))),\n\t);\n\n\tlet (sampl, mipmapped) = (\n\t\t&Sampler::linear(),\n\t\t&Sampler!(\n\t\t\t(TEXTURE_WRAP_R, CLAMP_TO_EDGE),\n\t\t\t(TEXTURE_WRAP_S, CLAMP_TO_EDGE),\n\t\t\t(TEXTURE_WRAP_T, CLAMP_TO_EDGE),\n\t\t\t(TEXTURE_MIN_FILTER, LINEAR_MIPMAP_LINEAR)\n\t\t),\n\t);\n\n\tlet large_text = (0..100)\n\t\t.map(|_| \"Functional textbox is capable of showing millions of lines with negligeble cpu usage!(so long as we're not editing, but that can be solved functionally as well)\\nBiggest issue is collecting the text to display, really - you can set large text range to 1000000 in release.\\n\\nUpper bar allows to drag layout around, pip on the bottom right resizes it.\\n\\n\\n\")\n\t\t.collect::();\n\n\tLayout::storage(ID!(\"menu\")).pos = (-10., -10.);\n\tLayout::storage(ID!(\"menu\")).size = (1.5, 2.);\n\tTextEdit::storage(ID!(\"text\")).text = large_text.into();\n\tSlider::storage(ID!(\"metallicity\")).pip_pos = 0.885;\n\tSlider::storage(ID!(\"roughness\")).pip_pos = 0.286;\n\tSlider::storage(ID!(\"rotation\")).pip_pos = 0.1;\n\n\tlet show_tooltip = |hovered, p: Vec2, msg: &str, r: &mut RenderLock| {\n\t\tif timeout(hovered) {\n\t\t\tlet size = (0.03, 0.1).mul((msg.len(), 1));\n\t\t\tr.clip(p, size);\n\t\t\tr.Label(ID!(\"Tooltip\"), p.sum(size.mul(0.05)), size, msg);\n\t\t\tr.unclip();\n\t\t}\n\t};\n\n\tlet mut exit = false;\n\tlet mut mouse_pos = (0., 0.);\n\tlet mut options = [\"stanford_dragon\", \"dr\", \"tyra\", \"not a model\"].map(String::from);\n\tlet mut demo_mesh = DeferredMesh::default();\n\tlet mut loading_in_progress;\n\tlet mut magnification = 0.3;\n\tlet mut rotation = 0_f32;\n\n\tfor i in (0..100).chain((0..100).step_by(1).rev()).map(|i| f32(i) / 100.).cycle() {\n\t\tlet mut r = renderer.lock();\n\n\t\tlet mut cam1 = Camera::zero((&window, (70, 10)));\n\t\t{\n\t\t\twindow.bind();\n\t\t\twindow.clear((0, 1));\n\n\t\t\tlet metallicity = 0.995 * r.Slider(ID!(\"metallicity\"), (0.3, -0.88), (1., 0.05), 0.05);\n\t\t\tlet roughness = (0.05 + r.Slider(ID!(\"roughness\"), (0.3, -0.94), (1., 0.05), 0.05)) / 1.05;\n\t\t\tr.Label(ID!(\"metal_v\"), (1.31, -0.88), (0.3, 0.05), &format!(\"Metal: {:.3}\", metallicity));\n\t\t\tr.Label(ID!(\"rough_v\"), (1.31, -0.94), (0.3, 0.05), &format!(\"Rough: {:.3}\", roughness));\n\t\t\tlet model_name = Selector::storage(ID!(\"model\")).choice;\n\t\t\tlet model_name = options[model_name].clone();\n\t\t\tr.Selector(ID!(\"model\"), (1.31, -0.82), (0.6, 0.1), &mut options);\n\n\t\t\tlet t = 1. - i;\n\n\t\t\tuse glm::{vec3 as v3, vec4 as v4, Mat4 as m4};\n\t\t\tlet m = magnification;\n\t\t\tlet model = &glm::translate(\n\t\t\t\t&glm::rotate(&glm::scale(&glm::identity(), &v3(m, m, m)), 90_f32.to_radians(), &v3(-1., 0., 0.)),\n\t\t\t\t&v3(0., 0., -0.3),\n\t\t\t);\n\t\t\tlet (c, s, cam_world) = {\n\t\t\t\trotation += r.Slider(ID!(\"rotation\"), (0.3, -1.), (1., 0.05), 0.05) * 0.01;\n\t\t\t\tlet (c, s) = (rotation.cos(), rotation.sin()).mul(0.3);\n\t\t\t\tlet t = t.to_radians() * 90.;\n\t\t\t\t(t.cos(), t.sin(), (s, 0., c))\n\t\t\t};\n\n\t\t\tcam1.setView((cam_world, Vec3::zero(), (0, 1, 0)));\n\t\t\tlet view = m4::to(cam1.V());\n\t\t\tlet (irr, spec, lut) = (skybox.irradiance.Bind(sampl), skybox.specular.Bind(mipmapped), brdf_lut.Bind(sampl));\n\t\t\tlet _ = Uniforms!(\n\t\t\t\trender_shd,\n\t\t\t\t(\"irradiance_cubetex\", &irr),\n\t\t\t\t(\"specular_cubetex\", &spec),\n\t\t\t\t(\"brdf_lut_tex\", &lut),\n\t\t\t\t(\"MVPMat\", cam1.MVP(model)),\n\t\t\t\t(\"ModelViewMat\", cam1.MV(model)),\n\t\t\t\t(\"NormalViewMat\", cam1.NV(model)),\n\t\t\t\t(\"NormalMat\", cam1.N(model)),\n\t\t\t\t(\"iCameraWorld\", Vec3(cam_world)),\n\t\t\t\t(\n\t\t\t\t\t\"iLightPos\",\n\t\t\t\t\t[\n\t\t\t\t\t\tVec4(view * v4(6. * c, 6. * s, 0., 1.)).xyz(),\n\t\t\t\t\t\tVec4(view * v4(2. * c, 0., 2. * s, 1.)).xyz(),\n\t\t\t\t\t\tVec4(view * v4(c, s, -2., 1.)).xyz(),\n\t\t\t\t\t\tVec4(view * v4(-1.5 * s, 1. * c, -2., 1.)).xyz()\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t\t(\"iLightColor\", [(1., 0., 0., 2.), (0., 0., 1., 2.), (1., 0., 1., 2.), (0., 1., 0., 2.)]),\n\t\t\t\t(\"iAlbedo\", hex_to_rgba(0xD4AF3700).xyz()),\n\t\t\t\t(\"iMetallicity\", metallicity),\n\t\t\t\t(\"iRoughness\", roughness),\n\t\t\t\t(\"iExposure\", 1.),\n\t\t\t\t(\"iMaxLod\", skybox.mip_levels)\n\t\t\t);\n\t\t\tloading_in_progress = !demo_mesh.draw(&model_name);\n\t\t}\n\t\t{\n\t\t\tlet s = skybox.specular.Bind(mipmapped);\n\t\t\tlet _ = Uniforms!(skybox_shd, (\"skybox_tex\", &s), (\"MVPMat\", cam1.VP()), (\"iExposure\", 1.));\n\t\t\tSkybox::Draw();\n\t\t}\n\n\t\tr.Layout(ID!(\"menu\"), |r, (pos, size)| {\n\t\t\tlet (button_w, button_h, padding) = (0.18, 0.06, 0.01);\n\t\t\tlet button = |n| (pos.sum(size.mul((button_w * f32(n) + padding * f32(n * 2 + 1), padding))), size.mul((button_w, button_h)));\n\n\t\t\tr.TextEdit(\n\t\t\t\tID!(\"text\"),\n\t\t\t\tpos.sum(size.mul((0, button_h + padding * 2.))),\n\t\t\t\tsize.mul((1, 1. - (button_h + padding * 3.))),\n\t\t\t\t0.05,\n\t\t\t);\n\n\t\t\tlet (p, s) = button(4);\n\t\t\texit = r.Button(ID!(\"exit\"), p, s, \"Exit\");\n\t\t\tshow_tooltip(r.hovers_in((p, p.sum(s))) && !exit, p.sum(s.mul(0.5)), \"GUI is easy!\", r);\n\t\t});\n\n\t\tif loading_in_progress {\n\t\t\tr.draw(primitives::Sprite {\n\t\t\t\tpos: mouse_pos,\n\t\t\t\tsize: (40., 40.).div(window.aspect()).div(window.size()),\n\t\t\t\tcolor: (1., 1. - i, 1., 1.),\n\t\t\t\ttex: spinner.frame(i),\n\t\t\t});\n\t\t}\n\n\t\tlet mut events = window.poll_events();\n\t\tevents.iter().rev().find_map(|e| map_enum!(MouseMove { at, .. } = e => mouse_pos = *at));\n\t\tr.sync_clipboard(&mut window);\n\t\trenderer = r.unlock(&mut window, &mut events);\n\t\twindow.swap();\n\n\t\tfor e in events {\n\t\t\tmatch e {\n\t\t\t\tKeyboard { key, state } if Key::Escape == key && state.pressed() => exit = true,\n\t\t\t\tScroll { at, .. } => {\n\t\t\t\t\tmagnification = (magnification + 0.01 * at.y()).clamp(0.01, 1.);\n\t\t\t\t\trotation += 0.2 * at.x()\n\t\t\t\t}\n\t\t\t\t_ => (), //println!(\"{e:?}\"),\n\t\t\t}\n\t\t}\n\n\t\tif exit {\n\t\t\treturn;\n\t\t}\n\t\tuse events::{Event::*, *};\n\t}\n}\n\nfn timeout(active: bool) -> bool {\n\tunsafe {\n\t\tstatic mut TIME: usize = 0;\n\t\tTIME += 1;\n\t\tif !active {\n\t\t\tTIME = 0\n\t\t}\n\t\tTIME > 60\n\t}\n}\n\n#[derive(Default)]\nstruct DeferredMesh {\n\thandle: Option)>>,\n\tmesh: Option<(String, Box)>,\n}\nimpl DeferredMesh {\n\tfn draw(&mut self, name: &str) -> bool {\n\t\tlet Self { handle, mesh } = self;\n\t\tif let Some((n, m)) = mesh {\n\t\t\tm.Draw();\n\t\t\tif n == name {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif handle.is_none() {\n\t\t\tlet name = name.to_string();\n\t\t\t*mesh = Some((\"\".into(), Box::new(Mesh::make_sphere(0.1, 8))));\n\t\t\t*handle = Some(task::spawn(async move { (name.clone(), Model::new_cached(&name)) }));\n\t\t}\n\n\t\tlet handle = handle.as_mut().valid();\n\t\tlet mut ready = task::block_on(async move { task::poll_once(handle).await });\n\n\t\tif ready.is_some() {\n\t\t\tself.handle = None;\n\t\t\tlet (n, m) = ready.take().valid();\n\t\t\tlet m: Box = m.map_or_else(\n\t\t\t\t|e| {\n\t\t\t\t\tWARN!(\"Failed to load {n:?}, {e}\");\n\t\t\t\t\tMesh::make_sphere(0.1, 8).to_trait()\n\t\t\t\t},\n\t\t\t\t|m| Mesh::from(m).to_trait(),\n\t\t\t);\n\t\t\t*mesh = Some((n, m));\n\t\t}\n\t\tfalse\n\t}\n}\n", "uri": "file:///_/code/rust/frontier/main.rs", "version": 0 } } } 07:26:14.356 Client { "jsonrpc": "2.0", "method": "$/cancelRequest", "params": { "id": "{ce7bd50c-1685-4dd8-8a1e-ede854494501}" } } 07:26:14.356 Client { "id": "{7c23f142-393c-4a4c-a9ff-9cbfe8f73e55}", "jsonrpc": "2.0", "method": "textDocument/semanticTokens/full", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:14.359 Client { "jsonrpc": "2.0", "method": "$/cancelRequest", "params": { "id": "{82f29cb1-2f01-4866-a6b3-ec14f61c6f4c}" } } 07:26:14.359 Server { "id": 0, "jsonrpc": "2.0", "method": "client/registerCapability", "params": { "registrations": [ { "id": "textDocument/didSave", "method": "textDocument/didSave", "registerOptions": { "documentSelector": [ { "pattern": "**/*.rs" }, { "pattern": "**/Cargo.toml" }, { "pattern": "**/Cargo.lock" } ], "includeText": false } } ] } } 07:26:14.359 Client { "id": 0, "jsonrpc": "2.0", "result": null } 07:26:14.359 Server { "id": 1, "jsonrpc": "2.0", "method": "workspace/configuration", "params": { "items": [ { "section": "rust-analyzer" } ] } } 07:26:14.359 Client { "error": { "code": -32601 }, "id": 1, "jsonrpc": "2.0" } 07:26:14.359 Server { "id": 2, "jsonrpc": "2.0", "method": "window/workDoneProgress/create", "params": { "token": "rustAnalyzer/Fetching" } } 07:26:14.359 Client { "id": 2, "jsonrpc": "2.0", "result": null } 07:26:14.359 Server { "jsonrpc": "2.0", "method": "$/progress", "params": { "token": "rustAnalyzer/Fetching", "value": { "kind": "begin", "title": "Fetching" } } } 07:26:14.360 Server { "error": { "code": -32801, "message": "waiting for cargo metadata or cargo check" }, "id": "{7c23f142-393c-4a4c-a9ff-9cbfe8f73e55}", "jsonrpc": "2.0" } 07:26:14.360 Client { "id": "{52aa51b5-99f9-4d66-b848-f7a844be5986}", "jsonrpc": "2.0", "method": "textDocument/semanticTokens/full", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:14.360 Client { "jsonrpc": "2.0", "method": "$/cancelRequest", "params": { "id": "{52aa51b5-99f9-4d66-b848-f7a844be5986}" } } 07:26:14.360 Client { "id": "{549417fa-8f81-476f-aaf2-5898793ca6d2}", "jsonrpc": "2.0", "method": "textDocument/semanticTokens/full", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:14.549 Client { "id": "{6b9b4571-ba6b-481d-b779-0770e1eb0dac}", "jsonrpc": "2.0", "method": "textDocument/documentSymbol", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:14.597 Client { "id": "{92fc4da8-e48a-44bd-a5c5-8ea2b91f0044}", "jsonrpc": "2.0", "method": "textDocument/documentHighlight", "params": { "position": { "character": 37, "line": 97 }, "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:20.131 Client { "id": "{e17a03f2-b670-406a-b2c5-0a4722fe8c84}", "jsonrpc": "2.0", "method": "initialize", "params": { "capabilities": { "textDocument": { "codeAction": { "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ "*" ] } } }, "completion": { "completionItem": { "commitCharacterSupport": true, "snippetSupport": true }, "completionItemKind": { "valueSet": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 ] }, "dynamicRegistration": true }, "definition": { "dynamicRegistration": true }, "documentHighlight": { "dynamicRegistration": true }, "documentSymbol": { "hierarchicalDocumentSymbolSupport": true, "symbolKind": { "valueSet": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 ] } }, "formatting": { "dynamicRegistration": true }, "hover": { "contentFormat": [ "markdown", "plaintext" ], "dynamicRegistration": true }, "implementation": { "dynamicRegistration": true }, "onTypeFormatting": { "dynamicRegistration": true }, "rangeFormatting": { "dynamicRegistration": true }, "references": { "dynamicRegistration": true }, "rename": { "dynamicRegistration": true, "prepareSupport": true }, "semanticTokens": { "dynamicRegistration": true, "formats": [ "relative" ], "requests": { "full": { "delta": true } }, "tokenModifiers": [ "declaration", "definition" ], "tokenTypes": [ "type", "class", "enumMember", "typeParameter", "parameter", "variable", "function", "macro", "keyword", "comment", "string", "number", "operator" ] }, "signatureHelp": { "dynamicRegistration": true, "signatureInformation": { "activeParameterSupport": true, "documentationFormat": [ "markdown", "plaintext" ] } }, "synchronization": { "didSave": true, "dynamicRegistration": true, "willSave": true, "willSaveWaitUntil": false }, "typeDefinition": { "dynamicRegistration": true } }, "window": { "workDoneProgress": true }, "workspace": { "applyEdit": true, "configuration": true, "didChangeConfiguration": { "dynamicRegistration": true }, "executeCommand": { "dynamicRegistration": true }, "semanticTokens": { "refreshSupport": true }, "workspaceFolders": true } }, "clientInfo": { "name": "Qt Creator", "version": "9.0.0-beta2" }, "initializationOptions": { }, "processId": 17940, "rootUri": "file:///_/code/rust", "trace": "off", "workspaceFolders": [ { "name": "py", "uri": "file:///_/code/py" }, { "name": "rust", "uri": "file:///_/code/rust" } ] } } 07:26:20.136 Server { "id": "{e17a03f2-b670-406a-b2c5-0a4722fe8c84}", "jsonrpc": "2.0", "result": { "capabilities": { "callHierarchyProvider": true, "codeActionProvider": { "codeActionKinds": [ "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite" ], "resolveProvider": true }, "codeLensProvider": { "resolveProvider": true }, "completionProvider": { "completionItem": { "labelDetailsSupport": false }, "triggerCharacters": [ ":", ".", "'", "(" ] }, "declarationProvider": true, "definitionProvider": true, "documentFormattingProvider": true, "documentHighlightProvider": true, "documentOnTypeFormattingProvider": { "firstTriggerCharacter": "=", "moreTriggerCharacter": [ ".", ">", "{" ] }, "documentRangeFormattingProvider": false, "documentSymbolProvider": true, "experimental": { "externalDocs": true, "hoverRange": true, "joinLines": true, "matchingBrace": true, "moveItem": true, "onEnter": true, "openCargoToml": true, "parentModule": true, "runnables": { "kinds": [ "cargo" ] }, "ssr": true, "workspaceSymbolScopeKindFiltering": true }, "foldingRangeProvider": true, "hoverProvider": true, "implementationProvider": true, "inlayHintProvider": { "resolveProvider": true }, "referencesProvider": true, "renameProvider": { "prepareProvider": true }, "selectionRangeProvider": true, "semanticTokensProvider": { "full": { "delta": true }, "legend": { "tokenModifiers": [ "documentation", "declaration", "static", "defaultLibrary", "async", "attribute", "callable", "constant", "consuming", "controlFlow", "crateRoot", "injected", "intraDocLink", "library", "mutable", "public", "reference", "trait", "unsafe" ], "tokenTypes": [ "comment", "decorator", "enumMember", "enum", "function", "interface", "keyword", "macro", "method", "namespace", "number", "operator", "parameter", "property", "string", "struct", "typeParameter", "variable", "angle", "arithmetic", "attribute", "attributeBracket", "bitwise", "boolean", "brace", "bracket", "builtinAttribute", "builtinType", "character", "colon", "comma", "comparison", "constParameter", "derive", "deriveHelper", "dot", "escapeSequence", "formatSpecifier", "generic", "label", "lifetime", "logical", "macroBang", "parenthesis", "punctuation", "selfKeyword", "selfTypeKeyword", "semicolon", "typeAlias", "toolModule", "union", "unresolvedReference" ] }, "range": true }, "signatureHelpProvider": { "triggerCharacters": [ "(", ",", "<" ] }, "textDocumentSync": { "change": 2, "openClose": true, "save": { } }, "typeDefinitionProvider": true, "workspace": { "fileOperations": { "willRename": { "filters": [ { "pattern": { "glob": "**/*.rs", "matches": "file" }, "scheme": "file" }, { "pattern": { "glob": "**", "matches": "folder" }, "scheme": "file" } ] } } }, "workspaceSymbolProvider": true }, "serverInfo": { "name": "rust-analyzer", "version": "1.65.0 (897e375 2022-11-02)" } } } 07:26:20.137 Client { "jsonrpc": "2.0", "method": "initialized", "params": { } } 07:26:20.137 Client { "jsonrpc": "2.0", "method": "workspace/didChangeConfiguration", "params": { "settings": "" } } 07:26:20.138 Client { "jsonrpc": "2.0", "method": "textDocument/didOpen", "params": { "textDocument": { "languageId": "rust", "text": "#![warn(clippy::all)]\n#![allow(clippy::many_single_char_names)]\n\nuse grafix_toolbox::{gui::*, *};\nuse uses::{asyn::*, math::*, *};\nuse GL::{atlas::*, font::*, mesh::*, pbrt::*, window::*, *};\n\nfn main() {\n\tLOGGER!(logging::Term, INFO);\n\n\tShaderManager::LoadSources(\"shd_pbrt.glsl\");\n\n\tlet mut window = TIMER!(window, {\n\t\tlet win = EXPECT!(Window::get((50, 50, 200, 100), \"Engine\"));\n\t\tGLEnable!(DEPTH_TEST, BLEND, MULTISAMPLE, TEXTURE_CUBE_MAP_SEAMLESS, DEPTH_WRITEMASK);\n\t\tGLDisable!(CULL_FACE);\n\t\tGL::BlendFunc::Set((gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA));\n\t\tGL::DepthFunc::Set(gl::LESS);\n\t\twin\n\t});\n\n\tlet font = {\n\t\tlet alphabet = (9..=9).chain(32_u8..127).map(|n| n as char).collect::() + \"ёйцукенгшщзхъфывапролджэячсмитьбюЁЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ\";\n\t\tFont::new_cached(\"UbuntuMono-R\", alphabet)\n\t};\n\n\tlet mut renderer = Renderer::new(Theme {\n\t\teasing: 10.,\n\t\tbg: (0.2, 0.2, 0.2, 0.7),\n\t\tbg_focus: hex_to_rgba(0x596475A0),\n\t\tfg: hex_to_rgba(0x626975FF),\n\t\tfg_focus: hex_to_rgba(0x461E5CCF),\n\t\thighlight: (0.9, 0.4, 0.1, 1.),\n\t\ttext: (1., 0.9, 0.9, 0.9),\n\t\ttext_focus: (1., 1., 1., 1.),\n\t\ttext_highlight: (0.2, 0.2, 0.2, 1.),\n\t\tfont,\n\t\tfont_size: 0.8,\n\t});\n\n\tlet atlas = TexAtlas::::new();\n\tlet _cat = atlas.load(\"ortodox_grafix.webp\");\n\tlet mut spinner = EXPECT!(Animation::from_file(\"spinner\", &atlas));\n\n\tlet (skybox, brdf_lut) = (EnvTex::from(EXPECT!(Environment::new_cached(\"lythwood_lounge_4k\"))), Environment::lut_cached());\n\n\tlet (mut skybox_shd, mut render_shd) = (\n\t\tEXPECT!(Shader::new((\"vs_skybox\", \"ps_skybox\"))),\n\t\tEXPECT!(Shader::new((\"vs_material_based_render\", \"ps_material_based_render\"))),\n\t);\n\n\tlet (sampl, mipmapped) = (\n\t\t&Sampler::linear(),\n\t\t&Sampler!(\n\t\t\t(TEXTURE_WRAP_R, CLAMP_TO_EDGE),\n\t\t\t(TEXTURE_WRAP_S, CLAMP_TO_EDGE),\n\t\t\t(TEXTURE_WRAP_T, CLAMP_TO_EDGE),\n\t\t\t(TEXTURE_MIN_FILTER, LINEAR_MIPMAP_LINEAR)\n\t\t),\n\t);\n\n\tlet large_text = (0..100)\n\t\t.map(|_| \"Functional textbox is capable of showing millions of lines with negligeble cpu usage!(so long as we're not editing, but that can be solved functionally as well)\\nBiggest issue is collecting the text to display, really - you can set large text range to 1000000 in release.\\n\\nUpper bar allows to drag layout around, pip on the bottom right resizes it.\\n\\n\\n\")\n\t\t.collect::();\n\n\tLayout::storage(ID!(\"menu\")).pos = (-10., -10.);\n\tLayout::storage(ID!(\"menu\")).size = (1.5, 2.);\n\tTextEdit::storage(ID!(\"text\")).text = large_text.into();\n\tSlider::storage(ID!(\"metallicity\")).pip_pos = 0.885;\n\tSlider::storage(ID!(\"roughness\")).pip_pos = 0.286;\n\tSlider::storage(ID!(\"rotation\")).pip_pos = 0.1;\n\n\tlet show_tooltip = |hovered, p: Vec2, msg: &str, r: &mut RenderLock| {\n\t\tif timeout(hovered) {\n\t\t\tlet size = (0.03, 0.1).mul((msg.len(), 1));\n\t\t\tr.clip(p, size);\n\t\t\tr.Label(ID!(\"Tooltip\"), p.sum(size.mul(0.05)), size, msg);\n\t\t\tr.unclip();\n\t\t}\n\t};\n\n\tlet mut exit = false;\n\tlet mut mouse_pos = (0., 0.);\n\tlet mut options = [\"stanford_dragon\", \"dr\", \"tyra\", \"not a model\"].map(String::from);\n\tlet mut demo_mesh = DeferredMesh::default();\n\tlet mut loading_in_progress;\n\tlet mut magnification = 0.3;\n\tlet mut rotation = 0_f32;\n\n\tfor i in (0..100).chain((0..100).step_by(1).rev()).map(|i| f32(i) / 100.).cycle() {\n\t\tlet mut r = renderer.lock();\n\n\t\tlet mut cam1 = Camera::zero((&window, (70, 10)));\n\t\t{\n\t\t\twindow.bind();\n\t\t\twindow.clear((0, 1));\n\n\t\t\tlet metallicity = 0.995 * r.Slider(ID!(\"metallicity\"), (0.3, -0.88), (1., 0.05), 0.05);\n\t\t\tlet roughness = (0.05 + r.Slider(ID!(\"roughness\"), (0.3, -0.94), (1., 0.05), 0.05)) / 1.05;\n\t\t\tr.Label(ID!(\"metal_v\"), (1.31, -0.88), (0.3, 0.05), &format!(\"Metal: {:.3}\", metallicity));\n\t\t\tr.Label(ID!(\"rough_v\"), (1.31, -0.94), (0.3, 0.05), &format!(\"Rough: {:.3}\", roughness));\n\t\t\tlet model_name = Selector::storage(ID!(\"model\")).choice;\n\t\t\tlet model_name = options[model_name].clone();\n\t\t\tr.Selector(ID!(\"model\"), (1.31, -0.82), (0.6, 0.1), &mut options);\n\n\t\t\tlet t = 1. - i;\n\n\t\t\tuse glm::{vec3 as v3, vec4 as v4, Mat4 as m4};\n\t\t\tlet m = magnification;\n\t\t\tlet model = &glm::translate(\n\t\t\t\t&glm::rotate(&glm::scale(&glm::identity(), &v3(m, m, m)), 90_f32.to_radians(), &v3(-1., 0., 0.)),\n\t\t\t\t&v3(0., 0., -0.3),\n\t\t\t);\n\t\t\tlet (c, s, cam_world) = {\n\t\t\t\trotation += r.Slider(ID!(\"rotation\"), (0.3, -1.), (1., 0.05), 0.05) * 0.01;\n\t\t\t\tlet (c, s) = (rotation.cos(), rotation.sin()).mul(0.3);\n\t\t\t\tlet t = t.to_radians() * 90.;\n\t\t\t\t(t.cos(), t.sin(), (s, 0., c))\n\t\t\t};\n\n\t\t\tcam1.setView((cam_world, Vec3::zero(), (0, 1, 0)));\n\t\t\tlet view = m4::to(cam1.V());\n\t\t\tlet (irr, spec, lut) = (skybox.irradiance.Bind(sampl), skybox.specular.Bind(mipmapped), brdf_lut.Bind(sampl));\n\t\t\tlet _ = Uniforms!(\n\t\t\t\trender_shd,\n\t\t\t\t(\"irradiance_cubetex\", &irr),\n\t\t\t\t(\"specular_cubetex\", &spec),\n\t\t\t\t(\"brdf_lut_tex\", &lut),\n\t\t\t\t(\"MVPMat\", cam1.MVP(model)),\n\t\t\t\t(\"ModelViewMat\", cam1.MV(model)),\n\t\t\t\t(\"NormalViewMat\", cam1.NV(model)),\n\t\t\t\t(\"NormalMat\", cam1.N(model)),\n\t\t\t\t(\"iCameraWorld\", Vec3(cam_world)),\n\t\t\t\t(\n\t\t\t\t\t\"iLightPos\",\n\t\t\t\t\t[\n\t\t\t\t\t\tVec4(view * v4(6. * c, 6. * s, 0., 1.)).xyz(),\n\t\t\t\t\t\tVec4(view * v4(2. * c, 0., 2. * s, 1.)).xyz(),\n\t\t\t\t\t\tVec4(view * v4(c, s, -2., 1.)).xyz(),\n\t\t\t\t\t\tVec4(view * v4(-1.5 * s, 1. * c, -2., 1.)).xyz()\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t\t(\"iLightColor\", [(1., 0., 0., 2.), (0., 0., 1., 2.), (1., 0., 1., 2.), (0., 1., 0., 2.)]),\n\t\t\t\t(\"iAlbedo\", hex_to_rgba(0xD4AF3700).xyz()),\n\t\t\t\t(\"iMetallicity\", metallicity),\n\t\t\t\t(\"iRoughness\", roughness),\n\t\t\t\t(\"iExposure\", 1.),\n\t\t\t\t(\"iMaxLod\", skybox.mip_levels)\n\t\t\t);\n\t\t\tloading_in_progress = !demo_mesh.draw(&model_name);\n\t\t}\n\t\t{\n\t\t\tlet s = skybox.specular.Bind(mipmapped);\n\t\t\tlet _ = Uniforms!(skybox_shd, (\"skybox_tex\", &s), (\"MVPMat\", cam1.VP()), (\"iExposure\", 1.));\n\t\t\tSkybox::Draw();\n\t\t}\n\n\t\tr.Layout(ID!(\"menu\"), |r, (pos, size)| {\n\t\t\tlet (button_w, button_h, padding) = (0.18, 0.06, 0.01);\n\t\t\tlet button = |n| (pos.sum(size.mul((button_w * f32(n) + padding * f32(n * 2 + 1), padding))), size.mul((button_w, button_h)));\n\n\t\t\tr.TextEdit(\n\t\t\t\tID!(\"text\"),\n\t\t\t\tpos.sum(size.mul((0, button_h + padding * 2.))),\n\t\t\t\tsize.mul((1, 1. - (button_h + padding * 3.))),\n\t\t\t\t0.05,\n\t\t\t);\n\n\t\t\tlet (p, s) = button(4);\n\t\t\texit = r.Button(ID!(\"exit\"), p, s, \"Exit\");\n\t\t\tshow_tooltip(r.hovers_in((p, p.sum(s))) && !exit, p.sum(s.mul(0.5)), \"GUI is easy!\", r);\n\t\t});\n\n\t\tif loading_in_progress {\n\t\t\tr.draw(primitives::Sprite {\n\t\t\t\tpos: mouse_pos,\n\t\t\t\tsize: (40., 40.).div(window.aspect()).div(window.size()),\n\t\t\t\tcolor: (1., 1. - i, 1., 1.),\n\t\t\t\ttex: spinner.frame(i),\n\t\t\t});\n\t\t}\n\n\t\tlet mut events = window.poll_events();\n\t\tevents.iter().rev().find_map(|e| map_enum!(MouseMove { at, .. } = e => mouse_pos = *at));\n\t\tr.sync_clipboard(&mut window);\n\t\trenderer = r.unlock(&mut window, &mut events);\n\t\twindow.swap();\n\n\t\tfor e in events {\n\t\t\tmatch e {\n\t\t\t\tKeyboard { key, state } if Key::Escape == key && state.pressed() => exit = true,\n\t\t\t\tScroll { at, .. } => {\n\t\t\t\t\tmagnification = (magnification + 0.01 * at.y()).clamp(0.01, 1.);\n\t\t\t\t\trotation += 0.2 * at.x()\n\t\t\t\t}\n\t\t\t\t_ => (), //println!(\"{e:?}\"),\n\t\t\t}\n\t\t}\n\n\t\tif exit {\n\t\t\treturn;\n\t\t}\n\t\tuse events::{Event::*, *};\n\t}\n}\n\nfn timeout(active: bool) -> bool {\n\tunsafe {\n\t\tstatic mut TIME: usize = 0;\n\t\tTIME += 1;\n\t\tif !active {\n\t\t\tTIME = 0\n\t\t}\n\t\tTIME > 60\n\t}\n}\n\n#[derive(Default)]\nstruct DeferredMesh {\n\thandle: Option)>>,\n\tmesh: Option<(String, Box)>,\n}\nimpl DeferredMesh {\n\tfn draw(&mut self, name: &str) -> bool {\n\t\tlet Self { handle, mesh } = self;\n\t\tif let Some((n, m)) = mesh {\n\t\t\tm.Draw();\n\t\t\tif n == name {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif handle.is_none() {\n\t\t\tlet name = name.to_string();\n\t\t\t*mesh = Some((\"\".into(), Box::new(Mesh::make_sphere(0.1, 8))));\n\t\t\t*handle = Some(task::spawn(async move { (name.clone(), Model::new_cached(&name)) }));\n\t\t}\n\n\t\tlet handle = handle.as_mut().valid();\n\t\tlet mut ready = task::block_on(async move { task::poll_once(handle).await });\n\n\t\tif ready.is_some() {\n\t\t\tself.handle = None;\n\t\t\tlet (n, m) = ready.take().valid();\n\t\t\tlet m: Box = m.map_or_else(\n\t\t\t\t|e| {\n\t\t\t\t\tWARN!(\"Failed to load {n:?}, {e}\");\n\t\t\t\t\tMesh::make_sphere(0.1, 8).to_trait()\n\t\t\t\t},\n\t\t\t\t|m| Mesh::from(m).to_trait(),\n\t\t\t);\n\t\t\t*mesh = Some((n, m));\n\t\t}\n\t\tfalse\n\t}\n}\n", "uri": "file:///_/code/rust/frontier/main.rs", "version": 0 } } } 07:26:20.138 Client { "jsonrpc": "2.0", "method": "$/cancelRequest", "params": { "id": "{549417fa-8f81-476f-aaf2-5898793ca6d2}" } } 07:26:20.138 Client { "id": "{09505438-c7af-4161-a75a-73134067fba2}", "jsonrpc": "2.0", "method": "textDocument/semanticTokens/full", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:20.141 Client { "jsonrpc": "2.0", "method": "$/cancelRequest", "params": { "id": "{92fc4da8-e48a-44bd-a5c5-8ea2b91f0044}" } } 07:26:20.141 Server { "id": 0, "jsonrpc": "2.0", "method": "client/registerCapability", "params": { "registrations": [ { "id": "textDocument/didSave", "method": "textDocument/didSave", "registerOptions": { "documentSelector": [ { "pattern": "**/*.rs" }, { "pattern": "**/Cargo.toml" }, { "pattern": "**/Cargo.lock" } ], "includeText": false } } ] } } 07:26:20.141 Client { "id": 0, "jsonrpc": "2.0", "result": null } 07:26:20.141 Server { "id": 1, "jsonrpc": "2.0", "method": "workspace/configuration", "params": { "items": [ { "section": "rust-analyzer" } ] } } 07:26:20.141 Client { "error": { "code": -32601 }, "id": 1, "jsonrpc": "2.0" } 07:26:20.141 Server { "id": 2, "jsonrpc": "2.0", "method": "window/workDoneProgress/create", "params": { "token": "rustAnalyzer/Fetching" } } 07:26:20.141 Client { "id": 2, "jsonrpc": "2.0", "result": null } 07:26:20.141 Server { "jsonrpc": "2.0", "method": "$/progress", "params": { "token": "rustAnalyzer/Fetching", "value": { "kind": "begin", "title": "Fetching" } } } 07:26:20.142 Server { "error": { "code": -32801, "message": "waiting for cargo metadata or cargo check" }, "id": "{09505438-c7af-4161-a75a-73134067fba2}", "jsonrpc": "2.0" } 07:26:20.142 Client { "id": "{5901bedd-06ab-4fd0-ba40-cb5b700187d8}", "jsonrpc": "2.0", "method": "textDocument/semanticTokens/full", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:20.142 Client { "jsonrpc": "2.0", "method": "$/cancelRequest", "params": { "id": "{5901bedd-06ab-4fd0-ba40-cb5b700187d8}" } } 07:26:20.142 Client { "id": "{ef361684-a4f2-45fd-9925-bd8f1300b2a8}", "jsonrpc": "2.0", "method": "textDocument/semanticTokens/full", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:20.348 Client { "id": "{a08ae0c2-f3dd-45d6-adf7-e79b635d7e2e}", "jsonrpc": "2.0", "method": "textDocument/documentSymbol", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:20.380 Client { "id": "{ce196ab3-391b-48ac-9efb-728c2d7ca0a7}", "jsonrpc": "2.0", "method": "textDocument/documentHighlight", "params": { "position": { "character": 37, "line": 97 }, "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:25.384 Client { "id": "{ebf93ebf-523a-46e4-a4b2-20ea008fc299}", "jsonrpc": "2.0", "method": "initialize", "params": { "capabilities": { "textDocument": { "codeAction": { "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ "*" ] } } }, "completion": { "completionItem": { "commitCharacterSupport": true, "snippetSupport": true }, "completionItemKind": { "valueSet": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 ] }, "dynamicRegistration": true }, "definition": { "dynamicRegistration": true }, "documentHighlight": { "dynamicRegistration": true }, "documentSymbol": { "hierarchicalDocumentSymbolSupport": true, "symbolKind": { "valueSet": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 ] } }, "formatting": { "dynamicRegistration": true }, "hover": { "contentFormat": [ "markdown", "plaintext" ], "dynamicRegistration": true }, "implementation": { "dynamicRegistration": true }, "onTypeFormatting": { "dynamicRegistration": true }, "rangeFormatting": { "dynamicRegistration": true }, "references": { "dynamicRegistration": true }, "rename": { "dynamicRegistration": true, "prepareSupport": true }, "semanticTokens": { "dynamicRegistration": true, "formats": [ "relative" ], "requests": { "full": { "delta": true } }, "tokenModifiers": [ "declaration", "definition" ], "tokenTypes": [ "type", "class", "enumMember", "typeParameter", "parameter", "variable", "function", "macro", "keyword", "comment", "string", "number", "operator" ] }, "signatureHelp": { "dynamicRegistration": true, "signatureInformation": { "activeParameterSupport": true, "documentationFormat": [ "markdown", "plaintext" ] } }, "synchronization": { "didSave": true, "dynamicRegistration": true, "willSave": true, "willSaveWaitUntil": false }, "typeDefinition": { "dynamicRegistration": true } }, "window": { "workDoneProgress": true }, "workspace": { "applyEdit": true, "configuration": true, "didChangeConfiguration": { "dynamicRegistration": true }, "executeCommand": { "dynamicRegistration": true }, "semanticTokens": { "refreshSupport": true }, "workspaceFolders": true } }, "clientInfo": { "name": "Qt Creator", "version": "9.0.0-beta2" }, "initializationOptions": { }, "processId": 17940, "rootUri": "file:///_/code/rust", "trace": "off", "workspaceFolders": [ { "name": "py", "uri": "file:///_/code/py" }, { "name": "rust", "uri": "file:///_/code/rust" } ] } } 07:26:25.389 Server { "id": "{ebf93ebf-523a-46e4-a4b2-20ea008fc299}", "jsonrpc": "2.0", "result": { "capabilities": { "callHierarchyProvider": true, "codeActionProvider": { "codeActionKinds": [ "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite" ], "resolveProvider": true }, "codeLensProvider": { "resolveProvider": true }, "completionProvider": { "completionItem": { "labelDetailsSupport": false }, "triggerCharacters": [ ":", ".", "'", "(" ] }, "declarationProvider": true, "definitionProvider": true, "documentFormattingProvider": true, "documentHighlightProvider": true, "documentOnTypeFormattingProvider": { "firstTriggerCharacter": "=", "moreTriggerCharacter": [ ".", ">", "{" ] }, "documentRangeFormattingProvider": false, "documentSymbolProvider": true, "experimental": { "externalDocs": true, "hoverRange": true, "joinLines": true, "matchingBrace": true, "moveItem": true, "onEnter": true, "openCargoToml": true, "parentModule": true, "runnables": { "kinds": [ "cargo" ] }, "ssr": true, "workspaceSymbolScopeKindFiltering": true }, "foldingRangeProvider": true, "hoverProvider": true, "implementationProvider": true, "inlayHintProvider": { "resolveProvider": true }, "referencesProvider": true, "renameProvider": { "prepareProvider": true }, "selectionRangeProvider": true, "semanticTokensProvider": { "full": { "delta": true }, "legend": { "tokenModifiers": [ "documentation", "declaration", "static", "defaultLibrary", "async", "attribute", "callable", "constant", "consuming", "controlFlow", "crateRoot", "injected", "intraDocLink", "library", "mutable", "public", "reference", "trait", "unsafe" ], "tokenTypes": [ "comment", "decorator", "enumMember", "enum", "function", "interface", "keyword", "macro", "method", "namespace", "number", "operator", "parameter", "property", "string", "struct", "typeParameter", "variable", "angle", "arithmetic", "attribute", "attributeBracket", "bitwise", "boolean", "brace", "bracket", "builtinAttribute", "builtinType", "character", "colon", "comma", "comparison", "constParameter", "derive", "deriveHelper", "dot", "escapeSequence", "formatSpecifier", "generic", "label", "lifetime", "logical", "macroBang", "parenthesis", "punctuation", "selfKeyword", "selfTypeKeyword", "semicolon", "typeAlias", "toolModule", "union", "unresolvedReference" ] }, "range": true }, "signatureHelpProvider": { "triggerCharacters": [ "(", ",", "<" ] }, "textDocumentSync": { "change": 2, "openClose": true, "save": { } }, "typeDefinitionProvider": true, "workspace": { "fileOperations": { "willRename": { "filters": [ { "pattern": { "glob": "**/*.rs", "matches": "file" }, "scheme": "file" }, { "pattern": { "glob": "**", "matches": "folder" }, "scheme": "file" } ] } } }, "workspaceSymbolProvider": true }, "serverInfo": { "name": "rust-analyzer", "version": "1.65.0 (897e375 2022-11-02)" } } } 07:26:25.390 Client { "jsonrpc": "2.0", "method": "initialized", "params": { } } 07:26:25.390 Client { "jsonrpc": "2.0", "method": "workspace/didChangeConfiguration", "params": { "settings": "" } } 07:26:25.391 Client { "jsonrpc": "2.0", "method": "textDocument/didOpen", "params": { "textDocument": { "languageId": "rust", "text": "#![warn(clippy::all)]\n#![allow(clippy::many_single_char_names)]\n\nuse grafix_toolbox::{gui::*, *};\nuse uses::{asyn::*, math::*, *};\nuse GL::{atlas::*, font::*, mesh::*, pbrt::*, window::*, *};\n\nfn main() {\n\tLOGGER!(logging::Term, INFO);\n\n\tShaderManager::LoadSources(\"shd_pbrt.glsl\");\n\n\tlet mut window = TIMER!(window, {\n\t\tlet win = EXPECT!(Window::get((50, 50, 200, 100), \"Engine\"));\n\t\tGLEnable!(DEPTH_TEST, BLEND, MULTISAMPLE, TEXTURE_CUBE_MAP_SEAMLESS, DEPTH_WRITEMASK);\n\t\tGLDisable!(CULL_FACE);\n\t\tGL::BlendFunc::Set((gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA));\n\t\tGL::DepthFunc::Set(gl::LESS);\n\t\twin\n\t});\n\n\tlet font = {\n\t\tlet alphabet = (9..=9).chain(32_u8..127).map(|n| n as char).collect::() + \"ёйцукенгшщзхъфывапролджэячсмитьбюЁЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ\";\n\t\tFont::new_cached(\"UbuntuMono-R\", alphabet)\n\t};\n\n\tlet mut renderer = Renderer::new(Theme {\n\t\teasing: 10.,\n\t\tbg: (0.2, 0.2, 0.2, 0.7),\n\t\tbg_focus: hex_to_rgba(0x596475A0),\n\t\tfg: hex_to_rgba(0x626975FF),\n\t\tfg_focus: hex_to_rgba(0x461E5CCF),\n\t\thighlight: (0.9, 0.4, 0.1, 1.),\n\t\ttext: (1., 0.9, 0.9, 0.9),\n\t\ttext_focus: (1., 1., 1., 1.),\n\t\ttext_highlight: (0.2, 0.2, 0.2, 1.),\n\t\tfont,\n\t\tfont_size: 0.8,\n\t});\n\n\tlet atlas = TexAtlas::::new();\n\tlet _cat = atlas.load(\"ortodox_grafix.webp\");\n\tlet mut spinner = EXPECT!(Animation::from_file(\"spinner\", &atlas));\n\n\tlet (skybox, brdf_lut) = (EnvTex::from(EXPECT!(Environment::new_cached(\"lythwood_lounge_4k\"))), Environment::lut_cached());\n\n\tlet (mut skybox_shd, mut render_shd) = (\n\t\tEXPECT!(Shader::new((\"vs_skybox\", \"ps_skybox\"))),\n\t\tEXPECT!(Shader::new((\"vs_material_based_render\", \"ps_material_based_render\"))),\n\t);\n\n\tlet (sampl, mipmapped) = (\n\t\t&Sampler::linear(),\n\t\t&Sampler!(\n\t\t\t(TEXTURE_WRAP_R, CLAMP_TO_EDGE),\n\t\t\t(TEXTURE_WRAP_S, CLAMP_TO_EDGE),\n\t\t\t(TEXTURE_WRAP_T, CLAMP_TO_EDGE),\n\t\t\t(TEXTURE_MIN_FILTER, LINEAR_MIPMAP_LINEAR)\n\t\t),\n\t);\n\n\tlet large_text = (0..100)\n\t\t.map(|_| \"Functional textbox is capable of showing millions of lines with negligeble cpu usage!(so long as we're not editing, but that can be solved functionally as well)\\nBiggest issue is collecting the text to display, really - you can set large text range to 1000000 in release.\\n\\nUpper bar allows to drag layout around, pip on the bottom right resizes it.\\n\\n\\n\")\n\t\t.collect::();\n\n\tLayout::storage(ID!(\"menu\")).pos = (-10., -10.);\n\tLayout::storage(ID!(\"menu\")).size = (1.5, 2.);\n\tTextEdit::storage(ID!(\"text\")).text = large_text.into();\n\tSlider::storage(ID!(\"metallicity\")).pip_pos = 0.885;\n\tSlider::storage(ID!(\"roughness\")).pip_pos = 0.286;\n\tSlider::storage(ID!(\"rotation\")).pip_pos = 0.1;\n\n\tlet show_tooltip = |hovered, p: Vec2, msg: &str, r: &mut RenderLock| {\n\t\tif timeout(hovered) {\n\t\t\tlet size = (0.03, 0.1).mul((msg.len(), 1));\n\t\t\tr.clip(p, size);\n\t\t\tr.Label(ID!(\"Tooltip\"), p.sum(size.mul(0.05)), size, msg);\n\t\t\tr.unclip();\n\t\t}\n\t};\n\n\tlet mut exit = false;\n\tlet mut mouse_pos = (0., 0.);\n\tlet mut options = [\"stanford_dragon\", \"dr\", \"tyra\", \"not a model\"].map(String::from);\n\tlet mut demo_mesh = DeferredMesh::default();\n\tlet mut loading_in_progress;\n\tlet mut magnification = 0.3;\n\tlet mut rotation = 0_f32;\n\n\tfor i in (0..100).chain((0..100).step_by(1).rev()).map(|i| f32(i) / 100.).cycle() {\n\t\tlet mut r = renderer.lock();\n\n\t\tlet mut cam1 = Camera::zero((&window, (70, 10)));\n\t\t{\n\t\t\twindow.bind();\n\t\t\twindow.clear((0, 1));\n\n\t\t\tlet metallicity = 0.995 * r.Slider(ID!(\"metallicity\"), (0.3, -0.88), (1., 0.05), 0.05);\n\t\t\tlet roughness = (0.05 + r.Slider(ID!(\"roughness\"), (0.3, -0.94), (1., 0.05), 0.05)) / 1.05;\n\t\t\tr.Label(ID!(\"metal_v\"), (1.31, -0.88), (0.3, 0.05), &format!(\"Metal: {:.3}\", metallicity));\n\t\t\tr.Label(ID!(\"rough_v\"), (1.31, -0.94), (0.3, 0.05), &format!(\"Rough: {:.3}\", roughness));\n\t\t\tlet model_name = Selector::storage(ID!(\"model\")).choice;\n\t\t\tlet model_name = options[model_name].clone();\n\t\t\tr.Selector(ID!(\"model\"), (1.31, -0.82), (0.6, 0.1), &mut options);\n\n\t\t\tlet t = 1. - i;\n\n\t\t\tuse glm::{vec3 as v3, vec4 as v4, Mat4 as m4};\n\t\t\tlet m = magnification;\n\t\t\tlet model = &glm::translate(\n\t\t\t\t&glm::rotate(&glm::scale(&glm::identity(), &v3(m, m, m)), 90_f32.to_radians(), &v3(-1., 0., 0.)),\n\t\t\t\t&v3(0., 0., -0.3),\n\t\t\t);\n\t\t\tlet (c, s, cam_world) = {\n\t\t\t\trotation += r.Slider(ID!(\"rotation\"), (0.3, -1.), (1., 0.05), 0.05) * 0.01;\n\t\t\t\tlet (c, s) = (rotation.cos(), rotation.sin()).mul(0.3);\n\t\t\t\tlet t = t.to_radians() * 90.;\n\t\t\t\t(t.cos(), t.sin(), (s, 0., c))\n\t\t\t};\n\n\t\t\tcam1.setView((cam_world, Vec3::zero(), (0, 1, 0)));\n\t\t\tlet view = m4::to(cam1.V());\n\t\t\tlet (irr, spec, lut) = (skybox.irradiance.Bind(sampl), skybox.specular.Bind(mipmapped), brdf_lut.Bind(sampl));\n\t\t\tlet _ = Uniforms!(\n\t\t\t\trender_shd,\n\t\t\t\t(\"irradiance_cubetex\", &irr),\n\t\t\t\t(\"specular_cubetex\", &spec),\n\t\t\t\t(\"brdf_lut_tex\", &lut),\n\t\t\t\t(\"MVPMat\", cam1.MVP(model)),\n\t\t\t\t(\"ModelViewMat\", cam1.MV(model)),\n\t\t\t\t(\"NormalViewMat\", cam1.NV(model)),\n\t\t\t\t(\"NormalMat\", cam1.N(model)),\n\t\t\t\t(\"iCameraWorld\", Vec3(cam_world)),\n\t\t\t\t(\n\t\t\t\t\t\"iLightPos\",\n\t\t\t\t\t[\n\t\t\t\t\t\tVec4(view * v4(6. * c, 6. * s, 0., 1.)).xyz(),\n\t\t\t\t\t\tVec4(view * v4(2. * c, 0., 2. * s, 1.)).xyz(),\n\t\t\t\t\t\tVec4(view * v4(c, s, -2., 1.)).xyz(),\n\t\t\t\t\t\tVec4(view * v4(-1.5 * s, 1. * c, -2., 1.)).xyz()\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t\t(\"iLightColor\", [(1., 0., 0., 2.), (0., 0., 1., 2.), (1., 0., 1., 2.), (0., 1., 0., 2.)]),\n\t\t\t\t(\"iAlbedo\", hex_to_rgba(0xD4AF3700).xyz()),\n\t\t\t\t(\"iMetallicity\", metallicity),\n\t\t\t\t(\"iRoughness\", roughness),\n\t\t\t\t(\"iExposure\", 1.),\n\t\t\t\t(\"iMaxLod\", skybox.mip_levels)\n\t\t\t);\n\t\t\tloading_in_progress = !demo_mesh.draw(&model_name);\n\t\t}\n\t\t{\n\t\t\tlet s = skybox.specular.Bind(mipmapped);\n\t\t\tlet _ = Uniforms!(skybox_shd, (\"skybox_tex\", &s), (\"MVPMat\", cam1.VP()), (\"iExposure\", 1.));\n\t\t\tSkybox::Draw();\n\t\t}\n\n\t\tr.Layout(ID!(\"menu\"), |r, (pos, size)| {\n\t\t\tlet (button_w, button_h, padding) = (0.18, 0.06, 0.01);\n\t\t\tlet button = |n| (pos.sum(size.mul((button_w * f32(n) + padding * f32(n * 2 + 1), padding))), size.mul((button_w, button_h)));\n\n\t\t\tr.TextEdit(\n\t\t\t\tID!(\"text\"),\n\t\t\t\tpos.sum(size.mul((0, button_h + padding * 2.))),\n\t\t\t\tsize.mul((1, 1. - (button_h + padding * 3.))),\n\t\t\t\t0.05,\n\t\t\t);\n\n\t\t\tlet (p, s) = button(4);\n\t\t\texit = r.Button(ID!(\"exit\"), p, s, \"Exit\");\n\t\t\tshow_tooltip(r.hovers_in((p, p.sum(s))) && !exit, p.sum(s.mul(0.5)), \"GUI is easy!\", r);\n\t\t});\n\n\t\tif loading_in_progress {\n\t\t\tr.draw(primitives::Sprite {\n\t\t\t\tpos: mouse_pos,\n\t\t\t\tsize: (40., 40.).div(window.aspect()).div(window.size()),\n\t\t\t\tcolor: (1., 1. - i, 1., 1.),\n\t\t\t\ttex: spinner.frame(i),\n\t\t\t});\n\t\t}\n\n\t\tlet mut events = window.poll_events();\n\t\tevents.iter().rev().find_map(|e| map_enum!(MouseMove { at, .. } = e => mouse_pos = *at));\n\t\tr.sync_clipboard(&mut window);\n\t\trenderer = r.unlock(&mut window, &mut events);\n\t\twindow.swap();\n\n\t\tfor e in events {\n\t\t\tmatch e {\n\t\t\t\tKeyboard { key, state } if Key::Escape == key && state.pressed() => exit = true,\n\t\t\t\tScroll { at, .. } => {\n\t\t\t\t\tmagnification = (magnification + 0.01 * at.y()).clamp(0.01, 1.);\n\t\t\t\t\trotation += 0.2 * at.x()\n\t\t\t\t}\n\t\t\t\t_ => (), //println!(\"{e:?}\"),\n\t\t\t}\n\t\t}\n\n\t\tif exit {\n\t\t\treturn;\n\t\t}\n\t\tuse events::{Event::*, *};\n\t}\n}\n\nfn timeout(active: bool) -> bool {\n\tunsafe {\n\t\tstatic mut TIME: usize = 0;\n\t\tTIME += 1;\n\t\tif !active {\n\t\t\tTIME = 0\n\t\t}\n\t\tTIME > 60\n\t}\n}\n\n#[derive(Default)]\nstruct DeferredMesh {\n\thandle: Option)>>,\n\tmesh: Option<(String, Box)>,\n}\nimpl DeferredMesh {\n\tfn draw(&mut self, name: &str) -> bool {\n\t\tlet Self { handle, mesh } = self;\n\t\tif let Some((n, m)) = mesh {\n\t\t\tm.Draw();\n\t\t\tif n == name {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif handle.is_none() {\n\t\t\tlet name = name.to_string();\n\t\t\t*mesh = Some((\"\".into(), Box::new(Mesh::make_sphere(0.1, 8))));\n\t\t\t*handle = Some(task::spawn(async move { (name.clone(), Model::new_cached(&name)) }));\n\t\t}\n\n\t\tlet handle = handle.as_mut().valid();\n\t\tlet mut ready = task::block_on(async move { task::poll_once(handle).await });\n\n\t\tif ready.is_some() {\n\t\t\tself.handle = None;\n\t\t\tlet (n, m) = ready.take().valid();\n\t\t\tlet m: Box = m.map_or_else(\n\t\t\t\t|e| {\n\t\t\t\t\tWARN!(\"Failed to load {n:?}, {e}\");\n\t\t\t\t\tMesh::make_sphere(0.1, 8).to_trait()\n\t\t\t\t},\n\t\t\t\t|m| Mesh::from(m).to_trait(),\n\t\t\t);\n\t\t\t*mesh = Some((n, m));\n\t\t}\n\t\tfalse\n\t}\n}\n", "uri": "file:///_/code/rust/frontier/main.rs", "version": 0 } } } 07:26:25.391 Client { "jsonrpc": "2.0", "method": "$/cancelRequest", "params": { "id": "{ef361684-a4f2-45fd-9925-bd8f1300b2a8}" } } 07:26:25.391 Client { "id": "{3d814246-0d06-4812-879b-6bf9d39d101d}", "jsonrpc": "2.0", "method": "textDocument/semanticTokens/full", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:25.393 Client { "jsonrpc": "2.0", "method": "$/cancelRequest", "params": { "id": "{ce196ab3-391b-48ac-9efb-728c2d7ca0a7}" } } 07:26:25.394 Server { "id": 0, "jsonrpc": "2.0", "method": "client/registerCapability", "params": { "registrations": [ { "id": "textDocument/didSave", "method": "textDocument/didSave", "registerOptions": { "documentSelector": [ { "pattern": "**/*.rs" }, { "pattern": "**/Cargo.toml" }, { "pattern": "**/Cargo.lock" } ], "includeText": false } } ] } } 07:26:25.395 Client { "id": 0, "jsonrpc": "2.0", "result": null } 07:26:25.395 Server { "id": 1, "jsonrpc": "2.0", "method": "workspace/configuration", "params": { "items": [ { "section": "rust-analyzer" } ] } } 07:26:25.395 Client { "error": { "code": -32601 }, "id": 1, "jsonrpc": "2.0" } 07:26:25.395 Server { "id": 2, "jsonrpc": "2.0", "method": "window/workDoneProgress/create", "params": { "token": "rustAnalyzer/Fetching" } } 07:26:25.395 Client { "id": 2, "jsonrpc": "2.0", "result": null } 07:26:25.395 Server { "jsonrpc": "2.0", "method": "$/progress", "params": { "token": "rustAnalyzer/Fetching", "value": { "kind": "begin", "title": "Fetching" } } } 07:26:25.395 Server { "error": { "code": -32801, "message": "waiting for cargo metadata or cargo check" }, "id": "{3d814246-0d06-4812-879b-6bf9d39d101d}", "jsonrpc": "2.0" } 07:26:25.395 Client { "id": "{d15b6de5-8774-44d5-8e3b-c96b7c5ec116}", "jsonrpc": "2.0", "method": "textDocument/semanticTokens/full", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:25.395 Client { "jsonrpc": "2.0", "method": "$/cancelRequest", "params": { "id": "{d15b6de5-8774-44d5-8e3b-c96b7c5ec116}" } } 07:26:25.395 Client { "id": "{7ef79321-8d38-4d2e-95c4-f4ceea74488a}", "jsonrpc": "2.0", "method": "textDocument/semanticTokens/full", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:25.582 Client { "id": "{1ad1689c-b664-482f-a59f-55ae19a12694}", "jsonrpc": "2.0", "method": "textDocument/documentSymbol", "params": { "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } } 07:26:25.632 Client { "id": "{51d69340-ed98-4b77-981e-56f71b60059c}", "jsonrpc": "2.0", "method": "textDocument/documentHighlight", "params": { "position": { "character": 37, "line": 97 }, "textDocument": { "uri": "file:///_/code/rust/frontier/main.rs" } } }