Skip to content

Commit

Permalink
disable encoding v1
Browse files Browse the repository at this point in the history
  • Loading branch information
xunilrj committed Jan 13, 2025
1 parent 72a8ed4 commit 1a0cc4f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
1 change: 0 additions & 1 deletion sway-core/src/asm_generation/fuel/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,6 @@ impl FuelAsmBuilder<'_, '_> {
c,
"Cannot happen, we just checked",
);
dbg!();
init_mut_vars.push(InitMutVars {
stack_base_words,
var_size: var_size.clone(),
Expand Down
7 changes: 1 addition & 6 deletions sway-lsp/src/capabilities/code_lens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,17 @@ use std::{path::PathBuf, sync::Arc};

use lsp_types::{CodeLens, Url};

use crate::{capabilities::runnable, core::session::Session};
use crate::core::session::Session;

pub fn code_lens(session: &Arc<Session>, url: &Url) -> Vec<CodeLens> {
dbg!();
let _p = tracing::trace_span!("code_lens").entered();
dbg!();
let url_path = PathBuf::from(url.path());
dbg!(url_path.display().to_string());

// Construct code lenses for runnable functions
let runnables_for_path = session.runnables.get(&url_path);
dbg!(runnables_for_path.is_some());

let mut result: Vec<CodeLens> = runnables_for_path
.map(|runnables| {
dbg!(runnables.len());
runnables
.iter()
.map(|runnable| CodeLens {
Expand Down
13 changes: 1 addition & 12 deletions sway-lsp/src/core/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ pub fn compile(
engines,
retrigger_compilation,
&[],
&[],
&[sway_features::Feature::NewEncoding],
)
.map_err(LanguageServerError::FailedToCompile)
}
Expand Down Expand Up @@ -465,14 +465,12 @@ pub fn parse_project(
.build_plan_cache
.get_or_update(&session.sync.manifest_path(), || build_plan(uri))?;

dbg!();
let results = compile(
&build_plan,
engines,
retrigger_compilation,
lsp_mode.as_ref(),
)?;
dbg!();

// Check if the last result is None or if results is empty, indicating an error occurred in the compiler.
// If we don't return an error here, then we will likely crash when trying to access the Engines
Expand All @@ -481,12 +479,8 @@ pub fn parse_project(
return Err(LanguageServerError::ProgramsIsNone);
}

dbg!();
let diagnostics = traverse(results, engines, session.clone(), lsp_mode.as_ref())?;
dbg!(&session.compiled_program.read().typed.is_some());
dbg!(&diagnostics);
if let Some(config) = &lsp_mode {
dbg!();
// Only write the diagnostics results on didSave or didOpen.
if !config.optimized_build {
if let Some((errors, warnings)) = &diagnostics {
Expand All @@ -496,7 +490,6 @@ pub fn parse_project(
}
}

dbg!();
session.runnables.clear();
let path = uri.to_file_path().unwrap();
let program_id = program_id_from_path(&path, engines)?;
Expand Down Expand Up @@ -628,12 +621,9 @@ fn create_runnables(
decl_engine: &DeclEngine,
source_engine: &SourceEngine,
) {
dbg!();
let _p = tracing::trace_span!("create_runnables").entered();
// Insert runnable test functions.
dbg!();
for (decl, _) in root.into_iter().flat_map(|x| x.test_fns(decl_engine)) {
dbg!();
// Get the span of the first attribute if it exists, otherwise use the span of the function name.
let span = decl
.attributes
Expand All @@ -655,7 +645,6 @@ fn create_runnables(
ref main_function, ..
}) = typed_program.map(|x| &x.kind)
{
dbg!();
let main_function = decl_engine.get_function(main_function);
let span = main_function.name.span();
if let Some(source_id) = span.source_id() {
Expand Down

0 comments on commit 1a0cc4f

Please sign in to comment.