Skip to content

Instantly share code, notes, and snippets.

View filip-sakel's full-sized avatar

Filip Sakellariou filip-sakel

View GitHub Profile
@filip-sakel
filip-sakel / GSoC_2026_Forum_Post.md
Created September 1, 2026 02:29
GSoC_2026_Forum_Post

Forum Post

GSoC 2026: Qualified Name Lookup for swift-syntax

Introduction

As part of Google Summer of Code 2026, I implemented a preliminary version of qualified name lookup in swift-syntax under the mentorship of Pavel Yaskevich (@xedin). Building on Jakub Florek’s GSoC 2024 unqualified-name-lookup project, this effort exposes syntactic queries formerly confined to the Swift compiler as an easy-to-use API in the swift-syntax package. Now, swift-syntax can find definitions of types and type members, like a simplified version of an editor’s “jump to definition” function. Namely, developers of build tools, such as linters, code generators and macros, can determine which declaration a TypeSyntax refers to, or find that type’s members.

Motivation

@filip-sakel
filip-sakel / GSoC_2026_Final_Report.md
Last active August 24, 2026 03:54
Qualified Name Lookup for swift-syntax -- GSoC 2026 Final Report

GSoC 2026: Qualified Name Lookup for swift-syntax

Overview

As part of Google Summer of Code 2026, I implemented a basic version of qualified name lookup in swift-syntax. Like the GSoC 2024 unqualified-name-lookup project, this effort exposes syntactic queries formerly confined to the Swift compiler as an easy-to-use API in the swift-syntax package. Developers of build tools, such as linters, code generators and macros, can now ask swift-syntax which declaration a type reference in the user’s code refers to, or to find members of a type.

@filip-sakel
filip-sakel / TypeQualifier-design.md
Last active June 25, 2026 18:07
TypeQualifier Design Outline

Believe it or not, the diagram below is a simplified version 😅. Here's the main idea: you give TypeQualifier some type syntax (no semantic information), and it resolves it to extended nominal types: nominal declarations and all their accessible extensions.

First, we convert the given type syntax to an array of references we can more easily look up; e.g., (Collection & MyProto).Element becomes Collection.Element and MyProto.Element. Then, we split each type reference up into the base type and its member type; in our example, the base is Collection with member type Element. Like all type syntax, Collection depends on its declaration context, so we perform unqualified type lookup to find the referenced type declaration. For now, let’s assume unqualified lookup returns a nominal declaration. If the declaration is nested within an extension, its qualified name depends on the extended type, so we have to recursively resolve that before continuing. For instance, if we don’t resolve the extended type `

@filip-sakel
filip-sakel / TaskRacing.swift
Last active December 6, 2021 07:55
A Swift implementation concurrency structure safely racing two tasks against each other. This structure is useful for implementing operators like `debounce` for `AsyncSequence`.
//
// TaskRacing.swift
//
// Created by Filip Sakel on 21/6/21.
//
import Dispatch
// MARK: - Utilities